AssignRenderer: add renderEquals method...

...with (hopefully temporarily) hardcoded groups support
This commit is contained in:
Thomas Gelf 2016-10-21 18:07:47 +00:00
parent 8519a287dc
commit 0a6514928a
1 changed files with 18 additions and 5 deletions

View File

@ -54,6 +54,23 @@ class AssignRenderer
}
}
protected function renderEquals($column, $expression)
{
if ($column === 'groups') {
return sprintf(
'%s in %s',
$expression,
$column
);
} else {
return sprintf(
'%s == %s',
$column,
$expression
);
}
}
protected function renderFilterExpression($filter)
{
$column = $filter->getColumn();
@ -67,11 +84,7 @@ class AssignRenderer
} elseif ($filter instanceof FilterMatch) {
if (strpos($expression, '*') === false) {
return sprintf(
'%s == %s',
$column,
$expression
);
return $this->renderEquals($column, $expression);
} else {
return sprintf(
'match(%s, %s)',