function Fid::titleQuery
Override the behavior of titleQuery(). Get the filenames.
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/ file/ src/ Plugin/ views/ argument/ Fid.php, line 58 
Class
- Fid
- Argument handler to accept multiple file ids.
Namespace
Drupal\file\Plugin\views\argumentCode
public function titleQuery() {
  $storage = $this->entityTypeManager
    ->getStorage('file');
  $fids = $storage->getQuery()
    ->accessCheck(FALSE)
    ->condition('fid', $this->value, 'IN')
    ->execute();
  $files = $storage->loadMultiple($fids);
  $titles = [];
  foreach ($files as $file) {
    $titles[] = $file->getFilename();
  }
  return $titles;
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
