You are here

function similarterms_handler_argument_node_nid::query in Similar By Terms 7.2

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

Set up the query for this argument.

The argument sent may be found at $this->argument.

Parameters

bool $group_by: Whether the query uses a group-by.

Overrides views_handler_argument_numeric::query

File

views/similarterms_handler_argument_node_nid.inc, line 119

Class

similarterms_handler_argument_node_nid
Argument handler to accept a node id. based on node_handler_argument_node_nid except that it doesn't add a where clause to the query.

Code

function query($group_by = FALSE) {
  $this
    ->ensure_my_table();
  $this->query
    ->add_table('taxonomy_index', NULL, NULL, 'similarterms_taxonomy_index');
  $this->query
    ->add_where(0, "similarterms_taxonomy_index.tid", $this->tids, 'IN');

  // exclude the current node(s)
  if (empty($this->options['include_args'])) {
    $this->query
      ->add_where(0, "node.nid", $this->value, 'NOT IN');
  }
}