mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-28 13:36:12 +02:00
35 lines
955 B
PHP
Executable File
35 lines
955 B
PHP
Executable File
<?php
|
|
/**
|
|
* Matches on rows where the field is not equal to the given value.
|
|
*
|
|
* @deprecated 3.1 Use ExactMatchFilter:not instead
|
|
* @package framework
|
|
* @subpackage search
|
|
*/
|
|
class NegationFilter extends SearchFilter {
|
|
function __construct($fullName, $value = false, array $modifiers = array()) {
|
|
Deprecation::notice('3.1', 'Use ExactMatchFilter:not instead.');
|
|
$modifiers[] = 'not';
|
|
parent::__construct($fullName, $value, $modifiers);
|
|
}
|
|
|
|
public function apply(DataQuery $query) {
|
|
$filter = new ExactMatchFilter($this->getFullName(), $this->getValue(), $this->getModifiers());
|
|
return $filter->apply($query);
|
|
}
|
|
|
|
protected function applyOne(DataQuery $query) {
|
|
/* NO OP */
|
|
}
|
|
|
|
public function exclude(DataQuery $query) {
|
|
$filter = new ExactMatchFilter($this->getFullName(), $this->getValue(), $this->getModifiers());
|
|
return $filter->exclude($query);
|
|
}
|
|
|
|
protected function excludeOne(DataQuery $query) {
|
|
/* NO OP */
|
|
}
|
|
}
|
|
|