[DB] Fix bug in custom criteria format wrangling

This commit is contained in:
Hugo Sales 2021-04-16 15:55:50 +00:00 committed by Diogo Peralta Cordeiro
parent ec8ad1888a
commit f6dea6e162

View File

@ -113,7 +113,12 @@ abstract class DB
foreach ($criteria as $op => $exp) { foreach ($criteria as $op => $exp) {
if ($op == 'or' || $op == 'and') { if ($op == 'or' || $op == 'and') {
$method = "{$op}X"; $method = "{$op}X";
return $eb->{$method}(...self::buildExpression($eb, $exp)); $expr = self::buildExpression($eb, $exp);
if (is_array($expr)) {
return $eb->{$method}(...$expr);
} else {
return $eb->{$method}($expr);
}
} elseif ($op == 'is_null') { } elseif ($op == 'is_null') {
$expressions[] = $eb->isNull($exp); $expressions[] = $eb->isNull($exp);
} else { } else {