Made addGroupBy varadic
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
afbad7e15e
commit
c6eba3c925
|
@ -835,12 +835,14 @@ class QueryBuilder implements IQueryBuilder {
|
||||||
* ->addGroupBy('u.createdAt')
|
* ->addGroupBy('u.createdAt')
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param mixed $groupBy The grouping expression.
|
* @param mixed ...$groupBy The grouping expression.
|
||||||
*
|
*
|
||||||
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
|
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
|
||||||
*/
|
*/
|
||||||
public function addGroupBy($groupBy) {
|
public function addGroupBy(...$groupBys) {
|
||||||
$groupBys = is_array($groupBy) ? $groupBy : func_get_args();
|
if (count($groupBys) === 1 && is_array($groupBys[0])) {
|
||||||
|
$$groupBys = $groupBys[0];
|
||||||
|
}
|
||||||
|
|
||||||
call_user_func_array(
|
call_user_func_array(
|
||||||
[$this->queryBuilder, 'addGroupBy'],
|
[$this->queryBuilder, 'addGroupBy'],
|
||||||
|
|
|
@ -627,12 +627,12 @@ interface IQueryBuilder {
|
||||||
* ->addGroupBy('u.createdAt')
|
* ->addGroupBy('u.createdAt')
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param mixed $groupBy The grouping expression.
|
* @param mixed ...$groupBy The grouping expression.
|
||||||
*
|
*
|
||||||
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
|
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*/
|
*/
|
||||||
public function addGroupBy($groupBy);
|
public function addGroupBy(...$groupBy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a value for a column in an insert query.
|
* Sets a value for a column in an insert query.
|
||||||
|
|
Loading…
Reference in New Issue