class Taxonomy in Drupal 10
Same name and namespace in other branches
- 8 core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php \Drupal\taxonomy\Plugin\views\argument\Taxonomy
- 9 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\views\Plugin\views\argument\NumericArgument extends \Drupal\views\Plugin\views\argument\ArgumentPluginBase- class \Drupal\taxonomy\Plugin\views\argument\Taxonomy implements ContainerFactoryPluginInterface
 
Expanded class hierarchy of Taxonomy
15 string references to 'Taxonomy'
- BreadcrumbTest::testBreadCrumbs in core/modules/ system/ tests/ src/ Functional/ Menu/ BreadcrumbTest.php 
- Tests breadcrumbs on node and administrative paths.
- drupal6.php in core/modules/ migrate_drupal/ tests/ fixtures/ drupal6.php 
- A database agnostic dump for testing purposes.
- drupal7.php in core/modules/ tracker/ tests/ fixtures/ drupal7.php 
- A database agnostic dump for testing purposes.
- drupal7.php in core/modules/ rdf/ tests/ fixtures/ drupal7.php 
- A database agnostic dump for testing purposes.
- drupal7.php in core/modules/ migrate_drupal/ tests/ fixtures/ drupal7.php 
- A database agnostic dump for testing purposes.
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');
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| NumericArgument:: | public | property | The actual value which is used for querying. | |
| NumericArgument:: | public | function | 1 | |
| NumericArgument:: | protected | function | 1 | |
| NumericArgument:: | public | function | ||
| NumericArgument:: | public | function | ||
| NumericArgument:: | public | function | 1 | |
| NumericArgument:: | public | function | Override for specific title lookups. | 4 | 
| Taxonomy:: | protected | property | ||
| Taxonomy:: | public static | function | Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: | |
| Taxonomy:: | public | function | Override the behavior of title(). Get the title of the node. Overrides NumericArgument:: | |
| Taxonomy:: | public | function | 
