Made groupBy varadic
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
d6b93e6620
commit
afbad7e15e
|
@ -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'],
|
||||
|
|
|
@ -609,12 +609,12 @@ interface 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.
|
||||
* @since 8.2.0
|
||||
*/
|
||||
public function groupBy($groupBy);
|
||||
public function groupBy(...$groupBys);
|
||||
|
||||
/**
|
||||
* Adds a grouping expression to the query.
|
||||
|
|
Loading…
Reference in New Issue