You are here

function similarterms_handler_argument_node_nid::title_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::title_query()

Override the behavior of title(). Get the title of the node.

Overrides views_handler_argument_numeric::title_query

File

views/similarterms_handler_argument_node_nid.inc, line 13

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 title_query() {
  $titles = array();
  $select = db_select('node', 'n');
  $select
    ->addField('n', 'title');
  $select
    ->condition('n.nid', $this->value, 'IN');
  $select
    ->addTag('node_access');
  $result = $select
    ->execute();
  foreach ($result as $term) {
    $titles[] = check_plain($term->title);
  }
  return $titles;
}