diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-12 16:09:35 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-04-12 16:09:35 +0200 |
commit | ac45af68cd7d30bb202e6b39ecf5bfcfd4b00225 (patch) | |
tree | db8e9c2672513ccd4ac9c4437b2dfb088b7d8073 /lib/private/DB/QueryBuilder | |
parent | 18580395d4095842462e035a2d947e716413d2fd (diff) | |
download | nextcloud-server-ac45af68cd7d30bb202e6b39ecf5bfcfd4b00225.tar.gz nextcloud-server-ac45af68cd7d30bb202e6b39ecf5bfcfd4b00225.zip |
Add sub() to the query function builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
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) . ')'); + } } |