function ManyToOne::opHelper

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

File

core/modules/views/src/Plugin/views/filter/ManyToOne.php, line 129

Class

ManyToOne
Complex filter to handle filtering for many to one relationships, such as terms (many terms per node) or roles (many roles per user).

Namespace

Drupal\views\Plugin\views\filter

Code

protected function opHelper() {
  if (empty($this->value)) {
    return;
  }
  // Form API returns unchecked options in the form of option_id => 0. This
  // breaks the generated query for "is all of" filters so we remove them.
  $this->value = array_filter($this->value, 'static::arrayFilterZero');
  $this->helper
    ->addFilter();
}

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