You are here

function apachesolr_views_handler_argument_tid::title in Apache Solr Views 6

File

handlers/apachesolr_views_handler_argument_tid.inc, line 5

Class

apachesolr_views_handler_argument_tid

Code

function title() {
  if (!empty($this->options['break_phrase'])) {
    $this->value = explode(',', $this->argument);
  }
  else {
    $this->value = array(
      $this->argument,
    );
  }
  $term_names = array();
  $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
  $result = db_query("SELECT td.name, td.tid FROM {term_data} td WHERE td.tid IN ({$placeholders})", $this->value);
  while ($term = db_fetch_object($result)) {
    $term_names[$term->tid] = check_plain($term->name);
  }
  return theme('apachesolr_views_term_titles', $term_names);
}