You are here

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

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

Overrides Numeric::title_query

File

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

Class

CategoryCid
Argument handler to accept an aggregator category id.

Namespace

Views\aggregator\Plugin\views\argument

Code

function title_query() {
  $titles = array();
  $query = db_select('aggregator_category', 'c');
  $query
    ->addField('c', 'title');
  $query
    ->condition('c.cid', $this->value);
  $result = $query
    ->execute();
  foreach ($result as $term) {
    $titles[] = check_plain($term->title);
  }
  return $titles;
}