diff options
Diffstat (limited to 'lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php')
-rw-r--r-- | lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php index 37518bda3ec..03630ea14a3 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php @@ -50,8 +50,13 @@ class FunctionBuilder implements IFunctionBuilder { return new QueryFunction('MD5(' . $this->helper->quoteColumnName($input) . ')'); } - public function concat($x, $y): IQueryFunction { - return new QueryFunction('CONCAT(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); + public function concat($x, ...$expr): IQueryFunction { + $args = func_get_args(); + $list = []; + foreach ($args as $item) { + $list[] = $this->helper->quoteColumnName($item); + } + return new QueryFunction(sprintf('CONCAT(%s)', implode(', ', $list))); } public function groupConcat($expr, ?string $separator = ','): IQueryFunction { |