summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-09-04 16:48:02 +0200
committerRobin Appelman <robin@icewind.nl>2019-09-06 12:28:17 +0200
commit8ef5a366eccaab850dab4641619c704a0b36f3d9 (patch)
tree66358c6d83850bc3ef08a65db5730e764779f0ca /lib/private
parent6d20876eb2aae5cb2269c7551e7a4f43e7a31222 (diff)
downloadnextcloud-server-8ef5a366eccaab850dab4641619c704a0b36f3d9.tar.gz
nextcloud-server-8ef5a366eccaab850dab4641619c704a0b36f3d9.zip
add MAX and MIN to functionbuilder
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
index a9d2f6f9a35..3b67661c8b0 100644
--- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
+++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
@@ -76,4 +76,12 @@ class FunctionBuilder implements IFunctionBuilder {
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
return new QueryFunction('COUNT(' . $this->helper->quoteColumnName($count) . ')' . $alias);
}
+
+ public function max($field) {
+ return new QueryFunction('MAX(' . $this->helper->quoteColumnName($field) . ')');
+ }
+
+ public function min($field) {
+ return new QueryFunction('MIN(' . $this->helper->quoteColumnName($field) . ')');
+ }
}