You are here

function search_api_exclude_views_handler_filter_status::query in Search API exclude 7

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_boolean_operator::query

File

views/handlers/search_api_exclude_views_handler_filter_status.inc, line 17
Definition of search_api_exclude_views_handler_filter_status.

Class

search_api_exclude_views_handler_filter_status
Filter by Search API exclude status.

Code

function query() {
  $table = $this
    ->ensure_my_table();
  if ($this->value == 1) {
    $this->query
      ->add_where_expression($this->options['group'], "{$table}.nid IS NOT NULL");
  }
  elseif ($this->value == 0) {
    $this->query
      ->add_where_expression($this->options['group'], "{$table}.nid IS NULL");
  }
}