You are here

function domain_views_handler_filter_domain_access_current_all::query in Domain Views 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

includes/domain_views_handler_filter_domain_access_current_all.inc, line 14
Interface between domain_views.module and views.module.

Class

domain_views_handler_filter_domain_access_current_all
Filter out nodes published to all domains or current domain

Code

function query() {
  $table = $this
    ->ensure_my_table();
  if (empty($this->value)) {
    $this->query
      ->add_where($this->options['group'], "(({$table}.realm = 'domain_id' AND {$table}.{$this->real_field} " . '<>' . " ***CURRENT_DOMAIN***))", array(), 'formula');
  }
  else {
    $this->query
      ->add_where($this->options['group'], "(({$table}.realm = 'domain_id' AND {$table}.{$this->real_field} " . '=' . " ***CURRENT_DOMAIN***) OR ({$table}.realm = 'domain_site' AND {$table}.{$this->real_field} = 0))", array(), 'formula');
  }
}