eZ\Publish\Core\Persistence\Doctrine\DoctrineExpression::combine PHP Method

combine() private method

Combine an array of expression by OR/AND.
private combine ( array $args, string $by ) : string
$args array
$by string
return string
    private function combine(array $args, $by)
    {
        $args = $this->arrayFlatten($args);
        if (count($args) < 1) {
            throw new QueryException("The expression '{$by}' expected at least 1 argument but none provided.");
        }
        if (count($args) === 1) {
            return $args[0];
        }
        return '( ' . implode($by, $args) . ' )';
    }