function InOperator::opEmpty

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

File

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

Class

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

Namespace

Drupal\views\Plugin\views\filter

Code

protected function opEmpty() {
    $this->ensureMyTable();
    if ($this->operator == 'empty') {
        $operator = "IS NULL";
    }
    else {
        $operator = "IS NOT NULL";
    }
    $this->query
        ->addWhere($this->options['group'], "{$this->tableAlias}.{$this->realField}", NULL, $operator);
}

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