function InOperator::operatorValues

Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::operatorValues()
  2. 10 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::operatorValues()
  3. 9 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::operatorValues()
  4. 8.9.x core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::operatorValues()

Gets the operators that have a given number of values.

4 calls to InOperator::operatorValues()
EntityReference::valueForm in core/modules/views/src/Plugin/views/filter/EntityReference.php
InOperator::adminSummary in core/modules/views/src/Plugin/views/filter/InOperator.php
InOperator::validate in core/modules/views/src/Plugin/views/filter/InOperator.php
InOperator::valueForm in core/modules/views/src/Plugin/views/filter/InOperator.php

File

core/modules/views/src/Plugin/views/filter/InOperator.php, line 180

Class

InOperator
Filter to handle matching of multiple options selectable via checkboxes.

Namespace

Drupal\views\Plugin\views\filter

Code

protected function operatorValues($values = 1) {
  $options = [];
  foreach ($this->operators() as $id => $info) {
    if (isset($info['values']) && $info['values'] == $values) {
      $options[] = $id;
    }
  }
  return $options;
}

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