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(). Get the title of the feed.

Overrides Numeric::title_query

File

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

Class

Fid
Argument handler to accept an aggregator feed id.

Namespace

Views\aggregator\Plugin\views\argument

Code

function title_query() {
  $titles = array();
  $result = db_query("SELECT f.title FROM {aggregator_feed} f WHERE f.fid IN (:fids)", array(
    ':fids' => $this->value,
  ));
  $query = db_select('aggregator_feed', 'f');
  $query
    ->addField('f', 'title');
  $query
    ->condition('f.fid', $this->value);
  $result = $query
    ->execute();
  foreach ($result as $term) {
    $titles[] = check_plain($term->title);
  }
  return $titles;
}