function Nid::titleQuery

Same name in other branches
  1. 8.9.x 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 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.