You are here

function nodereferrer_view_handler_argument::query in NodeReferrer 7

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

Update the query

Overrides views_handler_argument::query

File

views/nodereferrer_view_handler_argument.inc, line 83
nodereferrer.module Views integration

Class

nodereferrer_view_handler_argument
We use this as a parent class for both the nodereferrer arguments. 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) . ')';
    if (!$this->options['operator']) {
      $this->options['operator'] = 'in';
    }
    $this->query
      ->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field} " . $this->options['operator'] . ' ' . $in);
  }
}