You are here

public function DatabaseConnection_sqlsrv::mapConditionOperator in Drupal driver for SQL Server and SQL Azure 7

Same name and namespace in other branches
  1. 7.3 sqlsrv/database.inc \DatabaseConnection_sqlsrv::mapConditionOperator()
  2. 7.2 sqlsrv/database.inc \DatabaseConnection_sqlsrv::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 DatabaseConnection::mapConditionOperator

See also

DatabaseCondition::compile()

File

sqlsrv/database.inc, line 421
Database interface code for Microsoft SQL Server.

Class

DatabaseConnection_sqlsrv

Code

public function mapConditionOperator($operator) {

  // SQL Server doesn't need special escaping for the \ character in a string
  // literal, because it uses '' to escape the single quote, not \'.
  static $specials = array(
    'LIKE' => array(),
    'NOT LIKE' => array(),
  );
  return isset($specials[$operator]) ? $specials[$operator] : NULL;
}