aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
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
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')
-rw-r--r--phpBB/includes/db/dbal.php18
-rw-r--r--phpBB/includes/db/mssql.php12
-rw-r--r--phpBB/includes/db/mssql_odbc.php12
-rw-r--r--phpBB/includes/db/mssqlnative.php12
-rw-r--r--phpBB/includes/db/oracle.php12
-rw-r--r--phpBB/includes/db/postgres.php12
6 files changed, 39 insertions, 39 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;
}
/**
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index c64b289724..0345e4f8f8 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -94,13 +94,13 @@ class dbal_mssql extends dbal
/**
* {@inheritDoc}
*/
- 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 CAST(' . $action_true . ' AS VARCHAR)';
- $sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
- $sql_condition .= ' END';
- return $sql_condition;
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN CAST(' . $action_true . ' AS VARCHAR)';
+ $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
+ $sql_case .= ' END';
+ return $sql_case;
}
/**
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index d026e2d754..07da14bd53 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -112,13 +112,13 @@ class dbal_mssql_odbc extends dbal
/**
* {@inheritDoc}
*/
- 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 CAST(' . $action_true . ' AS VARCHAR)';
- $sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
- $sql_condition .= ' END';
- return $sql_condition;
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN CAST(' . $action_true . ' AS VARCHAR)';
+ $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
+ $sql_case .= ' END';
+ return $sql_case;
}
/**
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 36c52278d6..835b86f8c3 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -260,13 +260,13 @@ class dbal_mssqlnative extends dbal
/**
* {@inheritDoc}
*/
- 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 CAST(' . $action_true . ' AS VARCHAR)';
- $sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
- $sql_condition .= ' END';
- return $sql_condition;
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN CAST(' . $action_true . ' AS VARCHAR)';
+ $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
+ $sql_case .= ' END';
+ return $sql_case;
}
/**
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index f09e702951..9e08979bc1 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -92,13 +92,13 @@ class dbal_oracle extends dbal
/**
* {@inheritDoc}
*/
- 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 CAST(' . $action_true . ' AS clob)';
- $sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS clob)' : '';
- $sql_condition .= ' END';
- return $sql_condition;
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN CAST(' . $action_true . ' AS clob)';
+ $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS clob)' : '';
+ $sql_case .= ' END';
+ return $sql_case;
}
/**
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index 9da2fd0b40..1ceb0ed0a2 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -157,13 +157,13 @@ class dbal_postgres extends dbal
/**
* {@inheritDoc}
*/
- 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 CAST(' . $action_true . ' AS TEXT)';
- $sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS TEXT)' : '';
- $sql_condition .= ' END';
- return $sql_condition;
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN CAST(' . $action_true . ' AS TEXT)';
+ $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS TEXT)' : '';
+ $sql_case .= ' END';
+ return $sql_case;
}
/**