X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FPlugin%2Fviews%2Fargument%2FVocabularyVid.php;fp=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FPlugin%2Fviews%2Fargument%2FVocabularyVid.php;h=d2fe82072d472cb7b6fdacd02197610e19d3ce8a;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php b/web/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php new file mode 100644 index 000000000..d2fe82072 --- /dev/null +++ b/web/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php @@ -0,0 +1,66 @@ +vocabularyStorage = $vocabulary_storage; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('entity.manager')->getStorage('taxonomy_vocabulary') + ); + } + + /** + * Override the behavior of title(). Get the name of the vocabulary. + */ + public function title() { + $vocabulary = $this->vocabularyStorage->load($this->argument); + if ($vocabulary) { + return $vocabulary->label(); + } + + return $this->t('No vocabulary'); + } + +}