You are here

function Fid::title_query in Views (for Drupal 7) 8.3

Same name in this branch
  1. 8.3 lib/Views/file/Plugin/views/argument/Fid.php \Views\file\Plugin\views\argument\Fid::title_query()
  2. 8.3 lib/Views/aggregator/Plugin/views/argument/Fid.php \Views\aggregator\Plugin\views\argument\Fid::title_query()

Override the behavior of title_query(). Get the filenames.

Overrides Numeric::title_query

File

lib/Views/file/Plugin/views/argument/Fid.php, line 28
Definition of Views\file\Plugin\views\argument\Fid.

Class

Fid
Argument handler to accept multiple file ids.

Namespace

Views\file\Plugin\views\argument

Code

function title_query() {
  $titles = db_select('file_managed', 'f')
    ->fields('f', array(
    'filename',
  ))
    ->condition('fid', $this->value)
    ->execute()
    ->fetchCol();
  foreach ($titles as &$title) {
    $title = check_plain($title);
  }
  return $titles;
}