You are here

function nodereferrer_view_handler_filter::query in NodeReferrer 7

Same name and namespace in other branches
  1. 6 views/nodereferrer_view_handler_filter.inc \nodereferrer_view_handler_filter::query()

Update the query

Overrides views_handler_filter::query

File

views/nodereferrer_view_handler_filter.inc, line 91
nodereferrer.module Views integration

Class

nodereferrer_view_handler_filter
We use this as a parent class for both the nodereferrer filters. This handler is not meant to be used directly.

Code

function query() {
  $this
    ->ensure_my_table();
  $list = $this
    ->get_node_list();
  if (empty($list)) {
    if ($this->options['operator'] == 'in') {
      $this->query
        ->add_where($this->options['group'], 'FALSE');
    }
  }
  else {
    $in = '(' . implode(', ', $list) . ')';
    $this->query
      ->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field} " . $this->options['operator'] . ' ' . $in);
  }
}