Fix code style.

This commit is contained in:
David Molineus
2015-01-12 19:03:29 +01:00
parent 74c786c24b
commit 037c6c907d
77 changed files with 1068 additions and 398 deletions

View File

@@ -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);
}