function VocabularyVid::title in Views (for Drupal 7) 8.3
Override the behavior of title(). Get the name of the vocabulary.
Overrides Numeric::title
File
- lib/
Views/ taxonomy/ Plugin/ views/ argument/ VocabularyVid.php, line 28 - Definition of Views\taxonomy\Plugin\views\argument\VocabularyVid.
Class
- VocabularyVid
- Argument handler to accept a vocabulary id.
Namespace
Views\taxonomy\Plugin\views\argumentCode
function title() {
$query = db_select('taxonomy_vocabulary', 'v');
$query
->addField('v', 'name');
$query
->condition('v.vid', $this->argument);
$title = $query
->execute()
->fetchField();
if (empty($title)) {
return t('No vocabulary');
}
return check_plain($title);
}