forked from Snck3rs/contao-leaflet-maps
Fix code style.
This commit is contained in:
@@ -11,13 +11,18 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Model;
|
||||
|
||||
|
||||
/**
|
||||
* Class AbstractActiveModel is the base model for models with an active field.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Model
|
||||
*/
|
||||
abstract class AbstractActiveModel extends \Model
|
||||
{
|
||||
/**
|
||||
* Find an active model by its model id.
|
||||
*
|
||||
* @param int $modelId
|
||||
* @param array $options
|
||||
* @param int $modelId The model id.
|
||||
* @param array $options The query options.
|
||||
*
|
||||
* @return \Model|null
|
||||
*/
|
||||
@@ -27,18 +32,33 @@ abstract class AbstractActiveModel extends \Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Find active models by a defined column.
|
||||
*
|
||||
* @param int $value
|
||||
* @param array $options
|
||||
* @param string|array $column The query columns.
|
||||
* @param mixed $value The column value.
|
||||
* @param array $options The options.
|
||||
*
|
||||
* @return \Model|null
|
||||
*/
|
||||
public static function findActiveBy($column, $value, $options = array())
|
||||
{
|
||||
return static::findBy('active=1 AND ' . $column, $value, $options);
|
||||
if (is_array($column)) {
|
||||
$column[] = 'active=1';
|
||||
} else {
|
||||
$column = 'active=1 AND ' . $column;
|
||||
}
|
||||
|
||||
return static::findBy($column, $value, $options);
|
||||
}
|
||||
|
||||
public static function findActivated($options = array())
|
||||
/**
|
||||
* Find collection activated models.
|
||||
*
|
||||
* @param array $options The query options.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
*/
|
||||
public static function findActives($options = array())
|
||||
{
|
||||
return static::findBy('active', '1', $options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user