Skip to content
Snippets Groups Projects
Commit 6f8293a5 authored by Angie Byron's avatar Angie Byron
Browse files

#764418 by David_Rothstein, jpmckinney, quiptime, Crell: Move query...

#764418 by David_Rothstein, jpmckinney, quiptime, Crell: Move query conditional helper functions to database.inc to avoid fatal errors in lower bootstrap levels.
parent 8926b0a8
No related branches found
No related tags found
No related merge requests found
......@@ -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".
*/
......
......@@ -1357,47 +1357,6 @@ protected function mapConditionOperator($operator) {
}
/**
* 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 "ingroup database".
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment