mapConditionOperator

  1. drupal
    1. drupal7
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.

Übergabeparameter

$operator The condition operator, such as "IN", "BETWEEN", etc. Case-sensitive.

Rückgabewert

The extra handling directives for the specified operator, or NULL.

Verwandte Themen

Code

includes/database/query.inc, line 1217

<?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

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen