You are here

protected function ProximityFilter::opEmpty in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::opEmpty()
  2. 8.2 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::opEmpty()

Overrides NumericFilter::opEmpty

File

src/Plugin/views/filter/ProximityFilter.php, line 616

Class

ProximityFilter
Filter handler for search keywords.

Namespace

Drupal\geolocation\Plugin\views\filter

Code

protected function opEmpty($expression) {

  /** @var \Drupal\views\Plugin\views\query\Sql $query */
  $query = $this->query;
  if ($this->operator == 'empty') {
    $operator = "IS NULL";
  }
  else {
    $operator = "IS NOT NULL";
  }
  $query
    ->addWhereExpression($this->options['group'], $expression . ' ' . $operator);
}