public function Connection::mapConditionOperator

Same name in this branch
  1. 9.x drupal/core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::mapConditionOperator()
  2. 9.x drupal/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php \Drupal\Core\Database\Driver\mysql\Connection::mapConditionOperator()
  3. 9.x drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php \Drupal\Core\Database\Driver\sqlite\Connection::mapConditionOperator()
  4. 9.x drupal/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php \Drupal\Core\Database\Driver\pgsql\Connection::mapConditionOperator()

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

$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

drupal/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php, line 213
Definition of Drupal\Core\Database\Driver\pgsql\Connection

Class

Connection

Namespace

Drupal\Core\Database\Driver\pgsql

Code

public function mapConditionOperator($operator) {
  static $specials = array(
    // In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE
    // statements, we need to use ILIKE instead.
    'LIKE' => array(
      'operator' => 'ILIKE',
    ),
    'NOT LIKE' => array(
      'operator' => 'NOT ILIKE',
    ),
  );
  return isset($specials[$operator]) ? $specials[$operator] : NULL;
}