function String::op_empty

1 method overrides String::op_empty()
Combine::op_empty in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Combine.php

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php, line 340
Definition of Drupal\views\Plugin\views\filter\String.

Class

String
Basic textfield filter to handle string filtering commands including equality, like, not like, etc.

Namespace

Drupal\views\Plugin\views\filter

Code

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