You are here

public function DatabaseConnection_pgsql::mapConditionOperator in Drupal 7

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 DatabaseConnection::mapConditionOperator

See also

DatabaseCondition::compile()

File

includes/database/pgsql/database.inc, line 161
Database interface code for PostgreSQL database servers.

Class

DatabaseConnection_pgsql

Code

public function mapConditionOperator($operator) {
  static $specials;

  // Function calls not allowed in static declarations, thus this method.
  if (!isset($specials)) {
    $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;
}