class Taxonomy
Same name and namespace in other branches
- 11.x core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php \Drupal\taxonomy\Plugin\views\argument\Taxonomy
Argument handler for basic taxonomy tid.
Plugin annotation
@ViewsArgument("taxonomy");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\argument\ArgumentPluginBase extends \Drupal\Core\Cache\CacheableDependencyInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\argument\NumericArgument implements \Drupal\views\Plugin\views\argument\ArgumentPluginBase
- class \Drupal\taxonomy\Plugin\views\argument\Taxonomy extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface implements \Drupal\views\Plugin\views\argument\NumericArgument
- class \Drupal\views\Plugin\views\argument\NumericArgument implements \Drupal\views\Plugin\views\argument\ArgumentPluginBase
- class \Drupal\views\Plugin\views\argument\ArgumentPluginBase extends \Drupal\Core\Cache\CacheableDependencyInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Taxonomy
Related topics
103 string references to 'Taxonomy'
- BreadcrumbTest::testBreadCrumbs in core/
modules/ system/ tests/ src/ Functional/ Menu/ BreadcrumbTest.php - Tests breadcrumbs on node and administrative paths.
- core.entity_view_mode.taxonomy_term.full.yml in core/
modules/ taxonomy/ config/ install/ core.entity_view_mode.taxonomy_term.full.yml - core/modules/taxonomy/config/install/core.entity_view_mode.taxonomy_term.full.yml
- CreateTestContentEntitiesTrait::getRequiredModules in core/
modules/ migrate_drupal/ tests/ src/ Traits/ CreateTestContentEntitiesTrait.php - Gets required modules.
- demo_umami.info.yml in core/
profiles/ demo_umami/ demo_umami.info.yml - core/profiles/demo_umami/demo_umami.info.yml
- DependencyTest::testUninstallDependents in core/
modules/ system/ tests/ src/ Functional/ Module/ DependencyTest.php - Tests attempting to uninstall a module that has installed dependents.
File
-
core/
modules/ taxonomy/ src/ Plugin/ views/ argument/ Taxonomy.php, line 17
Namespace
Drupal\taxonomy\Plugin\views\argumentView source
class Taxonomy extends NumericArgument implements ContainerFactoryPluginInterface {
/**
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $termStorage;
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $term_storage) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->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_type.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');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.