diff options
Diffstat (limited to 'phpBB/includes/db/postgres.php')
-rw-r--r-- | phpBB/includes/db/postgres.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index dddf615f9c..a27fbb9d9f 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -157,6 +157,18 @@ class dbal_postgres extends dbal /** * {@inheritDoc} */ + function sql_conditional($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; + } + + /** + * {@inheritDoc} + */ function sql_concatenate($string1, $string2) { return $string1 . ' || ' . $string2; |