summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/QueryBuilder
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-06-20 17:53:31 +0200
committerRobin Appelman <robin@icewind.nl>2022-08-16 12:07:13 +0200
commit6e0123a1d0343b6b850ef6e3b341acf082fa0dce (patch)
tree06b4c66ede7fd3859ee02dd74ea4b7a8d60b46a2 /lib/private/DB/QueryBuilder
parent9b52663a81ef4db0aa458ed6b34dfaab872e3243 (diff)
downloadnextcloud-server-6e0123a1d0343b6b850ef6e3b341acf082fa0dce.tar.gz
nextcloud-server-6e0123a1d0343b6b850ef6e3b341acf082fa0dce.zip
Revert "add case statement to sql function builder"
This reverts commit 2a68819a67045d87a369a8a6413f153b3b2bea5f. Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/DB/QueryBuilder')
-rw-r--r--lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
index 408a879d624..e0a7549a0ad 100644
--- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
+++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
@@ -121,15 +121,4 @@ class FunctionBuilder implements IFunctionBuilder {
public function least($x, $y): IQueryFunction {
return new QueryFunction('LEAST(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')');
}
-
- public function case(array $whens, $else): IQueryFunction {
- if (count($whens) < 1) {
- return new QueryFunction($this->helper->quoteColumnName($else));
- }
-
- $whenParts = array_map(function (array $when) {
- return 'WHEN ' . $this->helper->quoteColumnName($when['when']) . ' THEN ' . $this->helper->quoteColumnName($when['then']);
- }, $whens);
- return new QueryFunction('CASE ' . implode(' ', $whenParts) . ' ELSE ' . $this->helper->quoteColumnName($else) . ' END');
- }
}