From afbad7e15ea1dc578d2af171b820d35c34899eb4 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:29:36 +0100 Subject: Made groupBy varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/private/DB/QueryBuilder') diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 0d0e6594b50..25e879b82be 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -807,12 +807,14 @@ class QueryBuilder implements IQueryBuilder { * ->groupBy('u.id'); * * - * @param mixed $groupBy The grouping expression. + * @param mixed ...$groupBys The grouping expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function groupBy($groupBy) { - $groupBys = is_array($groupBy) ? $groupBy : func_get_args(); + public function groupBy(...$groupBys) { + if (count($groupBys) === 1 && is_array($groupBys[0])) { + $$groupBys = $groupBys[0]; + } call_user_func_array( [$this->queryBuilder, 'groupBy'], -- cgit v1.2.3