| @@ 13-47 (lines=35) @@ | ||
| 10 | ||
| 11 | use ZfTable\Decorator\Condition\AbstractCondition; |
|
| 12 | ||
| 13 | class GreaterThan extends AbstractCondition |
|
| 14 | { |
|
| 15 | ||
| 16 | /** |
|
| 17 | * Name of column |
|
| 18 | * @var string |
|
| 19 | */ |
|
| 20 | protected $column; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Value |
|
| 24 | * @var array |
|
| 25 | */ |
|
| 26 | protected $value; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * |
|
| 30 | * @param array $options |
|
| 31 | */ |
|
| 32 | public function __construct($options) |
|
| 33 | { |
|
| 34 | $this->column = $options['column']; |
|
| 35 | $this->value = $options['value']; |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Check if the condition is valid |
|
| 40 | * @return boolean |
|
| 41 | */ |
|
| 42 | public function isValid() |
|
| 43 | { |
|
| 44 | $row = $this->getActulRow(); |
|
| 45 | return ($row[$this->column] > $this->value) ? true : false; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 13-47 (lines=35) @@ | ||
| 10 | ||
| 11 | use ZfTable\Decorator\Condition\AbstractCondition; |
|
| 12 | ||
| 13 | class LesserThan extends AbstractCondition |
|
| 14 | { |
|
| 15 | ||
| 16 | /** |
|
| 17 | * Name of column |
|
| 18 | * @var string |
|
| 19 | */ |
|
| 20 | protected $column; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Value |
|
| 24 | * @var array |
|
| 25 | */ |
|
| 26 | protected $value; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * |
|
| 30 | * @param array $options |
|
| 31 | */ |
|
| 32 | public function __construct($options) |
|
| 33 | { |
|
| 34 | $this->column = $options['column']; |
|
| 35 | $this->value = $options['value']; |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Check if the condition is valid |
|
| 40 | * @return boolean |
|
| 41 | */ |
|
| 42 | public function isValid() |
|
| 43 | { |
|
| 44 | $row = $this->getActulRow(); |
|
| 45 | return ($row[$this->column] < $this->value) ? true : false; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||