Connection::mapConditionOperator

public Connection::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. Database connections should define only those operators they wish to be handled differently than the default.

Parameters

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

Return value

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

Overrides Connection::mapConditionOperator

See also

\Drupal\Core\Database\Query\Condition::compile()

File

core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php, line 372

Class

Connection
SQLite implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\Core\Database\Driver\sqlite

Code

public function mapConditionOperator($operator) {
  // We don't want to override any of the defaults.
  static $specials = array(
    'LIKE' => array('postfix' => " ESCAPE '\\'"),
    'NOT LIKE' => array('postfix' => " ESCAPE '\\'"),
    'LIKE BINARY' => array('postfix' => " ESCAPE '\\'", 'operator' => 'GLOB'),
    'NOT LIKE BINARY' => array('postfix' => " ESCAPE '\\'", 'operator' => 'NOT GLOB'),
  );
  return isset($specials[$operator]) ? $specials[$operator] : NULL;
}
doc_Drupal
2016-10-29 08:55:53
Comments
Leave a Comment

Please login to continue.