AssignRenderer: support FilterMatchNot

This commit is contained in:
Thomas Gelf 2016-05-20 10:56:58 +02:00
parent dca6cc8a01
commit 8c54dcab81
1 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,7 @@ use Icinga\Data\Filter\FilterEqual;
use Icinga\Data\Filter\FilterGreaterThan;
use Icinga\Data\Filter\FilterLessThan;
use Icinga\Data\Filter\FilterMatch;
use Icinga\Data\Filter\FilterMatchNot;
use Icinga\Data\Filter\FilterNotEqual;
use Icinga\Exception\QueryException;
@ -79,6 +80,21 @@ class AssignRenderer
);
}
} elseif ($filter instanceof FilterMatchNot) {
if (strpos($expression, '*') === false) {
return sprintf(
'%s != %s',
$column,
$expression
);
} else {
return sprintf(
'! match(%s, %s)',
$expression,
$column
);
}
} elseif ($filter instanceof FilterNotEqual) {
return sprintf(
'%s != %s',