mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-18 15:36:30 +02:00
d370423825
All sapphire but the lang directory
21 lines
400 B
PHP
Executable File
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())
|
|
));
|
|
}
|
|
|
|
}
|
|
|