You are here

public function Vid::titleQuery in Drupal 9

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

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

Overrides NumericArgument::titleQuery

File

core/modules/node/src/Plugin/views/argument/Vid.php, line 71

Class

Vid
Argument handler to accept a node revision id.

Namespace

Drupal\node\Plugin\views\argument

Code

public function titleQuery() {
  $titles = [];
  $results = $this->nodeStorage
    ->getAggregateQuery()
    ->accessCheck(FALSE)
    ->allRevisions()
    ->groupBy('title')
    ->execute();
  foreach ($results as $result) {
    $titles[] = $result['title'];
  }
  return $titles;
}