termStorage = $term_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_term') ); } /** * Override the behavior of title(). Get the title of the node. */ public function title() { // There might be no valid argument. if ($this->argument) { $term = $this->termStorage->load($this->argument); if (!empty($term)) { return $term->getName(); } } // TODO review text return $this->t('No name'); } }