nodeTypeStorage = $node_type_storage; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $entity_manager = $container->get('entity.manager'); return new static( $configuration, $plugin_id, $plugin_definition, $entity_manager->getStorage('node_type') ); } /** * Override the behavior of summaryName(). Get the user friendly version * of the node type. */ public function summaryName($data) { return $this->node_type($data->{$this->name_alias}); } /** * Override the behavior of title(). Get the user friendly version of the * node type. */ public function title() { return $this->node_type($this->argument); } public function node_type($type_name) { $type = $this->nodeTypeStorage->load($type_name); $output = $type ? $type->label() : $this->t('Unknown content type'); return $output; } }