Made addGroupBy varadic
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
afbad7e15e
commit
c6eba3c925
2 changed files with 7 additions and 5 deletions
|
@ -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'],
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue