mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-07-09 04:49:40 +02:00
20 lines
345 B
PHP
20 lines
345 B
PHP
<?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) {
|
|
return $query->where(sprintf(
|
|
"%s != '%s'",
|
|
$this->getDbName(),
|
|
Convert::raw2sql($this->getValue())
|
|
));
|
|
}
|
|
|
|
}
|
|
|
|
?>
|