diff options
Diffstat (limited to 'lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php')
-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 3b67661c8b0..46bb536dfd2 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php @@ -72,9 +72,10 @@ class FunctionBuilder implements IFunctionBuilder { return new QueryFunction($this->helper->quoteColumnName($x) . ' - ' . $this->helper->quoteColumnName($y)); } - public function count($count, $alias = '') { + public function count($count = '', $alias = '') { $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; - return new QueryFunction('COUNT(' . $this->helper->quoteColumnName($count) . ')' . $alias); + $quotedName = $count === '' ? '*' : $this->helper->quoteColumnName($count); + return new QueryFunction('COUNT(' . $quotedName . ')' . $alias); } public function max($field) { |