aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/dbal.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-06-20 12:57:08 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-06-20 12:57:08 +0200
commit089e5f5c79965058a5288590a3a34d94f3bcb833 (patch)
tree0a018e866f14b4332ed7b620a327c7137df549bb /phpBB/includes/db/dbal.php
parent79dfdf94063cf7cc64197e50807977acaf9a2e66 (diff)
downloadforums-089e5f5c79965058a5288590a3a34d94f3bcb833.tar
forums-089e5f5c79965058a5288590a3a34d94f3bcb833.tar.gz
forums-089e5f5c79965058a5288590a3a34d94f3bcb833.tar.bz2
forums-089e5f5c79965058a5288590a3a34d94f3bcb833.tar.xz
forums-089e5f5c79965058a5288590a3a34d94f3bcb833.zip
[ticket/10942] Rename method sql_conditional() to sql_case()
PHPBB3-10942
Diffstat (limited to 'phpBB/includes/db/dbal.php')
-rw-r--r--phpBB/includes/db/dbal.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index e85de28a4c..9eb74ab617 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -284,20 +284,20 @@ class dbal
}
/**
- * Build a conditional SQL query
+ * Build a case expression
*
* @param string $condition The condition which must be true, to use action_true rather then action_else
- * @param string $action_true SQL statement that is used, if the condition is true
- * @param string $action_else SQL statement that is used, if the condition is false, optional
+ * @param string $action_true SQL expression that is used, if the condition is true
+ * @param string $action_else SQL expression that is used, if the condition is false, optional
* @return string CASE expression including the condition and statements
*/
- function sql_conditional($condition, $action_true, $action_false = false)
+ function sql_case($condition, $action_true, $action_false = false)
{
- $sql_condition = 'CASE WHEN ' . $condition;
- $sql_condition .= ' THEN ' . $action_true;
- $sql_condition .= ($action_false !== false) ? ' ELSE ' . $action_false : '';
- $sql_condition .= ' END';
- return $sql_condition;
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN ' . $action_true;
+ $sql_case .= ($action_false !== false) ? ' ELSE ' . $action_false : '';
+ $sql_case .= ' END';
+ return $sql_case;
}
/**