silverstripe-framework/search/filters/GreaterThanFilter.php
Fred Condo d370423825 Clean up trailing ?> per coding standard
All sapphire but the lang directory
2012-02-12 12:40:16 -08:00

28 lines
551 B
PHP

<?php
/**
* Selects numerical/date content greater than the input
*
* @todo documentation
*
* @package sapphire
* @subpackage search
*/
class GreaterThanFilter extends SearchFilter {
/**
* @return $query
*/
public function apply(DataQuery $query) {
$this->model = $query->applyRelation($this->relation);
return $query->where(sprintf(
"%s > '%s'",
$this->getDbName(),
Convert::raw2sql($this->getDbFormattedValue())
));
}
public function isEmpty() {
return $this->getValue() == null || $this->getValue() == '';
}
}