function ManyToOne::opHelper

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/ManyToOne.php \Drupal\views\Plugin\views\filter\ManyToOne::opHelper()
  2. 8.9.x core/modules/views/src/Plugin/views/filter/ManyToOne.php \Drupal\views\Plugin\views\filter\ManyToOne::opHelper()
  3. 10 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 132

Class

ManyToOne
Complex filter to handle filtering for many to one relationships.

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::class,
        'arrayFilterZero',
    ]);
    $this->helper
        ->addFilter();
}

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