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

21 lines
400 B
PHP
Executable File

<?php
/**
* Matches on rows where the field is not equal to the given value.
*
* @package sapphire
* @subpackage search
*/
class NegationFilter extends SearchFilter {
public function apply(DataQuery $query) {
$this->model = $query->applyRelation($this->relation);
return $query->where(sprintf(
"%s != '%s'",
$this->getDbName(),
Convert::raw2sql($this->getValue())
));
}
}