From 6f8293a5ae3350f6b5b6877e55accf1b1577d7c0 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 11 Apr 2010 01:12:23 +0000 Subject: #764418 by David_Rothstein, jpmckinney, quiptime, Crell: Move query conditional helper functions to database.inc to avoid fatal errors in lower bootstrap levels. --- includes/database/database.inc | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'includes/database/database.inc') diff --git a/includes/database/database.inc b/includes/database/database.inc index aa4cc671f..933a52819 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -2453,6 +2453,47 @@ function db_next_id($existing_id = 0) { return Database::getConnection()->nextId($existing_id); } +/** + * Returns a new DatabaseCondition, set to "OR" all conditions together. + * + * @return DatabaseCondition + */ +function db_or() { + return new DatabaseCondition('OR'); +} + +/** + * Returns a new DatabaseCondition, set to "AND" all conditions together. + * + * @return DatabaseCondition + */ +function db_and() { + return new DatabaseCondition('AND'); +} + +/** + * Returns a new DatabaseCondition, set to "XOR" all conditions together. + * + * @return DatabaseCondition + */ +function db_xor() { + return new DatabaseCondition('XOR'); +} + +/** + * Returns a new DatabaseCondition, set to the specified conjunction. + * + * Internal API function call. The db_and(), db_or(), and db_xor() + * functions are preferred. + * + * @param $conjunction + * The conjunction to use for query conditions (AND, OR or XOR). + * @return DatabaseCondition + */ +function db_condition($conjunction) { + return new DatabaseCondition($conjunction); +} + /** * @} End of "defgroup database". */ -- cgit v1.2.3