You are here

protected function GroupByNumeric::opEmpty in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/GroupByNumeric.php \Drupal\views\Plugin\views\filter\GroupByNumeric::opEmpty()
  2. 9 core/modules/views/src/Plugin/views/filter/GroupByNumeric.php \Drupal\views\Plugin\views\filter\GroupByNumeric::opEmpty()

Overrides NumericFilter::opEmpty

File

core/modules/views/src/Plugin/views/filter/GroupByNumeric.php, line 41

Class

GroupByNumeric
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
    ->addHavingExpression($this->options['group'], "{$field} {$operator}");
}