Made addGroupBy varadic

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-03-13 09:30:14 +01:00
parent afbad7e15e
commit c6eba3c925
No known key found for this signature in database
GPG key ID: F941078878347C0C
2 changed files with 7 additions and 5 deletions

View file

@ -835,12 +835,14 @@ class QueryBuilder implements IQueryBuilder {
* ->addGroupBy('u.createdAt')
* </code>
*
* @param mixed $groupBy The grouping expression.
* @param mixed ...$groupBy The grouping expression.
*
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
*/
public function addGroupBy($groupBy) {
$groupBys = is_array($groupBy) ? $groupBy : func_get_args();
public function addGroupBy(...$groupBys) {
if (count($groupBys) === 1 && is_array($groupBys[0])) {
$$groupBys = $groupBys[0];
}
call_user_func_array(
[$this->queryBuilder, 'addGroupBy'],

View file

@ -627,12 +627,12 @@ interface IQueryBuilder {
* ->addGroupBy('u.createdAt')
* </code>
*
* @param mixed $groupBy The grouping expression.
* @param mixed ...$groupBy The grouping expression.
*
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
* @since 8.2.0
*/
public function addGroupBy($groupBy);
public function addGroupBy(...$groupBy);
/**
* Sets a value for a column in an insert query.