summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 09:29:36 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 09:29:36 +0100
commitafbad7e15ea1dc578d2af171b820d35c34899eb4 (patch)
tree80f219a4bedd91a8a848eda4ea62a460185e0564 /lib/private/DB
parentd6b93e662024c35d02e8762d04c726c84c6c454a (diff)
downloadnextcloud-server-afbad7e15ea1dc578d2af171b820d35c34899eb4.tar.gz
nextcloud-server-afbad7e15ea1dc578d2af171b820d35c34899eb4.zip
Made groupBy varadic
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/QueryBuilder/QueryBuilder.php8
1 files changed, 5 insertions, 3 deletions
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');
* </code>
*
- * @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'],