You are here

function NodeTnid::title_query in Views (for Drupal 7) 8.3

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

Overrides Numeric::title_query

File

lib/Views/translation/Plugin/views/argument/NodeTnid.php, line 28
Definition of Views\translation\Plugin\views\argument\NodeTnid.

Class

NodeTnid
Argument handler to accept a node translation id.

Namespace

Views\translation\Plugin\views\argument

Code

function title_query() {
  $titles = array();
  $query = db_select('node', 'n');
  $query
    ->addField('n', 'title');
  $query
    ->condition('n.tnid', $this->value);
  $result = $query
    ->execute();
  foreach ($result as $term) {
    $titles[] = check_plain($term->title);
  }
  return $titles;
}