summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 09:25:32 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 09:25:32 +0100
commit2976b3910251b18a039b663433a95e2cccaec5e9 (patch)
tree664bcf92909a1a8ac75e89205ead992e4e5c4e33 /lib/private/DB
parentc8aee70a0b9d4f873a7327c13bb6b4763a6299a3 (diff)
downloadnextcloud-server-2976b3910251b18a039b663433a95e2cccaec5e9.tar.gz
nextcloud-server-2976b3910251b18a039b663433a95e2cccaec5e9.zip
Made AddSelect 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 c15470dcda8..4b3fd8449ce 100644
--- a/lib/private/DB/QueryBuilder/QueryBuilder.php
+++ b/lib/private/DB/QueryBuilder/QueryBuilder.php
@@ -452,12 +452,14 @@ class QueryBuilder implements IQueryBuilder {
* ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id');
* </code>
*
- * @param mixed $select The selection expression.
+ * @param mixed ...$selects The selection expression.
*
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
*/
- public function addSelect($select = null) {
- $selects = is_array($select) ? $select : func_get_args();
+ public function addSelect(...$selects) {
+ if (count($selects) === 1 && is_array($selects[0])) {
+ $selects = $selects[0];
+ }
$this->queryBuilder->addSelect(
$this->helper->quoteColumnNames($selects)