diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-12 12:55:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-12 12:55:09 -0500 |
commit | 124fdf8062139d5f1877e5fa9d0ce1969aa51e93 (patch) | |
tree | 2f937827859fbeb2869e358f173fb9c6e3242e72 /lib/private/DB/QueryBuilder | |
parent | 31024b7700e025c78c1da94ab77564adeca54dee (diff) | |
parent | ac45af68cd7d30bb202e6b39ecf5bfcfd4b00225 (diff) | |
download | nextcloud-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.php | 4 |
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) . ')'); + } } |