function ViewsConfigUpdater::mapOperatorFromSingleToMultiple

Same name in other branches
  1. 8.9.x core/modules/views/src/ViewsConfigUpdater.php \Drupal\views\ViewsConfigUpdater::mapOperatorFromSingleToMultiple()

Maps a single operator to a multiple one, if possible.

Parameters

string $single_operator: A single operator.

Return value

string A multiple operator or the original one if no mapping was available.

1 call to ViewsConfigUpdater::mapOperatorFromSingleToMultiple()
ViewsConfigUpdater::processMultivalueBaseFieldHandler in core/modules/views/src/ViewsConfigUpdater.php
Processes handlers affected by the multivalue base field update.

File

core/modules/views/src/ViewsConfigUpdater.php, line 473

Class

ViewsConfigUpdater
Provides a BC layer for modules providing old configurations.

Namespace

Drupal\views

Code

protected function mapOperatorFromSingleToMultiple($single_operator) {
    switch ($single_operator) {
        case '=':
            return 'or';
        case '!=':
            return 'not';
        default:
            return $single_operator;
    }
}

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