function Nid::titleQuery

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

Return value

array Returns all titles, if it's just one title it's an array with one entry.

Overrides NumericArgument::titleQuery

File

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.