summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/QueryBuilder
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-12 12:55:09 -0500
committerGitHub <noreply@github.com>2017-04-12 12:55:09 -0500
commit124fdf8062139d5f1877e5fa9d0ce1969aa51e93 (patch)
tree2f937827859fbeb2869e358f173fb9c6e3242e72 /lib/private/DB/QueryBuilder
parent31024b7700e025c78c1da94ab77564adeca54dee (diff)
parentac45af68cd7d30bb202e6b39ecf5bfcfd4b00225 (diff)
downloadnextcloud-server-124fdf8062139d5f1877e5fa9d0ce1969aa51e93.tar.gz
nextcloud-server-124fdf8062139d5f1877e5fa9d0ce1969aa51e93.zip
Merge pull request #4331 from nextcloud/query-builder-sum
Add sum() to the query function builder
Diffstat (limited to 'lib/private/DB/QueryBuilder')
-rw-r--r--lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
index 6bd98e4ce50..9ec8a9fd3c4 100644
--- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
+++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
@@ -53,4 +53,8 @@ class FunctionBuilder implements IFunctionBuilder {
return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ')');
}
}
+
+ public function sum($field) {
+ return new QueryFunction('SUM(' . $this->helper->quoteColumnName($field) . ')');
+ }
}