summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-10-19 16:44:28 +0200
committerJoas Schilling <coding@schilljs.com>2018-11-08 15:44:45 +0100
commitbb352fb667e87ea0829f1da5f9e85c34bdefe9fa (patch)
treecd243856dcfec5708528418b55269e3d7feed53a /lib/private/DB
parent78fd8ab0fd362fd5d568dfc5b47a02158e62d51c (diff)
downloadnextcloud-server-bb352fb667e87ea0829f1da5f9e85c34bdefe9fa.tar.gz
nextcloud-server-bb352fb667e87ea0829f1da5f9e85c34bdefe9fa.zip
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
index cf6183b0238..a9d2f6f9a35 100644
--- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
+++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
@@ -72,7 +72,8 @@ class FunctionBuilder implements IFunctionBuilder {
return new QueryFunction($this->helper->quoteColumnName($x) . ' - ' . $this->helper->quoteColumnName($y));
}
- public function count($input) {
- return new QueryFunction('COUNT(' . $this->helper->quoteColumnName($input) . ')');
+ public function count($count, $alias = '') {
+ $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
+ return new QueryFunction('COUNT(' . $this->helper->quoteColumnName($count) . ')' . $alias);
}
}