Condition::$conditionOperatorMap

Same name in other branches
  1. 9 core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition::conditionOperatorMap
  2. 8.9.x core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition::conditionOperatorMap
  3. 11.x core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition::conditionOperatorMap

Provides a map of condition operators to condition operator options.

Type: conditionOperatorMap

File

core/lib/Drupal/Core/Database/Query/Condition.php, line 16

Class

Condition
Generic class for a series of conditions in a query.

Namespace

Drupal\Core\Database\Query

Code

protected static $conditionOperatorMap = [
    'BETWEEN' => [
        'delimiter' => ' AND ',
    ],
    'NOT BETWEEN' => [
        'delimiter' => ' AND ',
    ],
    'IN' => [
        'delimiter' => ', ',
        'prefix' => '(',
        'postfix' => ')',
    ],
    'NOT IN' => [
        'delimiter' => ', ',
        'prefix' => '(',
        'postfix' => ')',
    ],
    'IS NULL' => [
        'use_value' => FALSE,
    ],
    'IS NOT NULL' => [
        'use_value' => FALSE,
    ],
    // Use backslash for escaping wildcard characters.
'LIKE' => [
        'postfix' => " ESCAPE '\\\\'",
    ],
    'NOT LIKE' => [
        'postfix' => " ESCAPE '\\\\'",
    ],
    // Exists expects an already bracketed subquery as right hand part. Do
    // not define additional brackets.
'EXISTS' => [],
    'NOT EXISTS' => [],
    // These ones are here for performance reasons.
'=' => [],
    '<' => [],
    '>' => [],
    '>=' => [],
    '<=' => [],
];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.