diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-11 01:12:23 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-11 01:12:23 +0000 |
commit | 6f8293a5ae3350f6b5b6877e55accf1b1577d7c0 (patch) | |
tree | 7171a97681f5a29cb9a41a62117a9a60945814b1 /includes/database/database.inc | |
parent | 8926b0a8c13b093128a2a84526b637897ac0b08e (diff) | |
download | brdo-6f8293a5ae3350f6b5b6877e55accf1b1577d7c0.tar.gz brdo-6f8293a5ae3350f6b5b6877e55accf1b1577d7c0.tar.bz2 |
#764418 by David_Rothstein, jpmckinney, quiptime, Crell: Move query conditional helper functions to database.inc to avoid fatal errors in lower bootstrap levels.
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r-- | includes/database/database.inc | 41 |
1 files changed, 41 insertions, 0 deletions
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 @@ -2454,6 +2454,47 @@ function db_next_id($existing_id = 0) { } /** + * 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". */ |