You are here

public function Nid::titleQuery in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/src/Plugin/views/argument/Nid.php \Drupal\node\Plugin\views\argument\Nid::titleQuery()
  2. 10 core/modules/node/src/Plugin/views/argument/Nid.php \Drupal\node\Plugin\views\argument\Nid::titleQuery()

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

Overrides NumericArgument::titleQuery

File

core/modules/node/src/Plugin/views/argument/Nid.php, line 54

Class

Nid
Argument handler to accept a node id.

Namespace

Drupal\node\Plugin\views\argument

Code

public function titleQuery() {
  $titles = [];
  $nodes = $this->nodeStorage
    ->loadMultiple($this->value);
  foreach ($nodes as $node) {
    $titles[] = $node
      ->label();
  }
  return $titles;
}