2008-08-11 02:03:57 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Selects numerical/date content greater than the input
|
|
|
|
*
|
|
|
|
* @todo documentation
|
|
|
|
*
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2008-08-11 02:03:57 +02:00
|
|
|
* @subpackage search
|
|
|
|
*/
|
|
|
|
class GreaterThanFilter extends SearchFilter {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return $query
|
|
|
|
*/
|
2011-03-21 09:37:55 +01:00
|
|
|
public function apply(DataQuery $query) {
|
|
|
|
$this->model = $query->applyRelation($this->relation);
|
2011-04-05 13:01:57 +02:00
|
|
|
return $query->where(sprintf(
|
2008-10-05 21:20:35 +02:00
|
|
|
"%s > '%s'",
|
|
|
|
$this->getDbName(),
|
2008-11-13 00:39:07 +01:00
|
|
|
Convert::raw2sql($this->getDbFormattedValue())
|
2008-10-05 21:20:35 +02:00
|
|
|
));
|
2008-08-11 02:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function isEmpty() {
|
|
|
|
return $this->getValue() == null || $this->getValue() == '';
|
|
|
|
}
|
|
|
|
}
|