mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-12 20:48:09 +02:00
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…
x
Reference in New Issue
Block a user