FilterOr: override operator change for NOT
Replacing an OR filter with a NOT operator should return a NOT OR when the OR contains more than one entry
This commit is contained in:
parent
1f74c462d4
commit
44c96f0410
|
@ -20,6 +20,14 @@ class FilterOr extends FilterChain
|
|||
return false;
|
||||
}
|
||||
|
||||
public function setOperatorName($name)
|
||||
{
|
||||
if ($this->count() > 1 && $name === 'NOT') {
|
||||
return Filter::not(clone $this);
|
||||
}
|
||||
return parent::setOperatorName($name);
|
||||
}
|
||||
|
||||
public function andFilter(Filter $filter)
|
||||
{
|
||||
return Filter::matchAll($this, $filter);
|
||||
|
|
Loading…
Reference in New Issue