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'); } }