You are here

function apachesolr_exclude_node_views_handler_filter_status::query in Apache Solr Exclude Node 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/apachesolr_exclude_node_views_handler_filter_status.inc, line 14
Definition of apachesolr_exclude_node_views_handler_filter_status.

Class

apachesolr_exclude_node_views_handler_filter_status
Filter by Apache Solr exclude status.

Code

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