function VocabularyMachineName::title

Override the behavior of title(). Get the name of the vocabulary..

Overrides String::title

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/VocabularyMachineName.php, line 28
Definition of Drupal\taxonomy\Plugin\views\argument\VocabularyMachineName.

Class

VocabularyMachineName
Argument handler to accept a vocabulary machine name.

Namespace

Drupal\taxonomy\Plugin\views\argument

Code

function title() {
  $query = db_select('taxonomy_vocabulary', 'v');
  $query
    ->addField('v', 'name');
  $query
    ->condition('v.machine_name', $this->argument);
  $title = $query
    ->execute()
    ->fetchField();
  if (empty($title)) {
    return t('No vocabulary');
  }
  return check_plain($title);
}