| Versionen | |
|---|---|
| drupal7 | protected DatabaseCondition::mapConditionOperator($operator) |
Gets any special processing requirements for the condition operator.
Some condition types require special processing, such as IN, because the value data they pass in is not a simple value. This is a simple overridable lookup function.
$operator The condition operator, such as "IN", "BETWEEN", etc. Case-sensitive.
The extra handling directives for the specified operator, or NULL.
includes/
<?php
protected function mapConditionOperator($operator) {
// $specials does not use drupal_static as its value never changes.
static $specials = array(
'BETWEEN' => array('delimiter' => ' AND '),
'IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),
'NOT IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),
'LIKE' => array('operator' => 'LIKE'),
'IS NULL' => array('use_value' => FALSE),
'IS NOT NULL' => array('use_value' => FALSE),
);
$return = isset($specials[$operator]) ? $specials[$operator] : array();
$return += array('operator' => $operator);
return $return;
}
?>
Kommentare
Kommentar hinzufügen