function 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 398

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);
}

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