You are here

protected function InOperator::opSimple in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::opSimple()
1 method overrides InOperator::opSimple()
ModerationStateFilter::opSimple in core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php

File

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

Class

InOperator
Simple filter to handle matching of multiple options selectable via checkboxes.

Namespace

Drupal\views\Plugin\views\filter

Code

protected function opSimple() {
  if (empty($this->value)) {
    return;
  }
  $this
    ->ensureMyTable();

  // We use array_values() because the checkboxes keep keys and that can cause
  // array addition problems.
  $this->query
    ->addWhere($this->options['group'], "{$this->tableAlias}.{$this->realField}", array_values($this->value), $this->operator);
}