diff options
Diffstat (limited to 'lib/private/DB')
-rw-r--r-- | lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php | 5 |
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); } } |