mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-18 23:46:21 +02:00
c49f7566c3
More modifiers can be added to each class as desired.
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 */
|
|
}
|
|
}
|
|
|