AssignRenderer: special treatment for not in group

fixes #686
This commit is contained in:
Thomas Gelf 2017-08-25 16:22:22 +02:00
parent bab28b1755
commit a6222e2abb
1 changed files with 18 additions and 5 deletions

View File

@ -75,6 +75,23 @@ class AssignRenderer
}
}
protected function renderNotEquals($column, $expression)
{
if (substr($column, -7) === '.groups') {
return sprintf(
'!(%s in %s)',
$expression,
$column
);
} else {
return sprintf(
'%s != %s',
$column,
$expression
);
}
}
protected function renderInArray($column, $expression)
{
return sprintf(
@ -147,11 +164,7 @@ class AssignRenderer
}
} elseif ($filter instanceof FilterMatchNot) {
if (strpos($expression, '*') === false) {
return sprintf(
'%s != %s',
$column,
$expression
);
return $this->renderNotEquals($column, $expression);
} else {
return sprintf(
'! match(%s, %s)',