function NumericFilter::opEmpty

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

File

core/modules/views/src/Plugin/views/filter/NumericFilter.php, line 368

Class

NumericFilter
Simple filter to handle greater than/less than filters.

Namespace

Drupal\views\Plugin\views\filter

Code

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

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