function IndexTidDepth::__construct

Same name in other branches
  1. 9 core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php \Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::__construct()
  2. 8.9.x core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php \Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::__construct()
  3. 11.x core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php \Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::__construct()

Overrides HandlerBase::__construct

File

core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php, line 41

Class

IndexTidDepth
Argument handler for taxonomy terms with depth.

Namespace

Drupal\taxonomy\Plugin\views\argument

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface|EntityRepositoryInterface $entityRepository) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    if ($entityRepository instanceof EntityStorageInterface) {
        // @phpstan-ignore-next-line
        $this->termStorage = $entityRepository;
        @trigger_error('Calling ' . __CLASS__ . '::__construct() with the $termStorage argument as \\Drupal\\Core\\Entity\\EntityStorageInterface is deprecated in drupal:10.3.0 and it will require Drupal\\Core\\Entity\\EntityRepositoryInterface in drupal:11.0.0. See https://www.drupal.org/node/3427843', E_USER_DEPRECATED);
        $this->entityRepository = \Drupal::service('entity.repository');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.