You are here

public function OverviewTerms::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Form/OverviewTerms.php \Drupal\taxonomy\Form\OverviewTerms::__construct()

Constructs an OverviewTerms object.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

\Drupal\Core\Render\RendererInterface $renderer: The renderer service.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.

\Drupal\Core\Pager\PagerManagerInterface|null $pager_manager: The pager manager.

File

core/modules/taxonomy/src/Form/OverviewTerms.php, line 95

Class

OverviewTerms
Provides terms overview form for a taxonomy vocabulary.

Namespace

Drupal\taxonomy\Form

Code

public function __construct(ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer = NULL, EntityRepositoryInterface $entity_repository = NULL, PagerManagerInterface $pager_manager = NULL) {
  $this->moduleHandler = $module_handler;
  $this->entityTypeManager = $entity_type_manager;
  $this->storageController = $entity_type_manager
    ->getStorage('taxonomy_term');
  $this->termListBuilder = $entity_type_manager
    ->getListBuilder('taxonomy_term');
  $this->renderer = $renderer ?: \Drupal::service('renderer');
  if (!$entity_repository) {
    @trigger_error('Calling OverviewTerms::__construct() with the $entity_repository argument is supported in drupal:8.7.0 and will be required before drupal:9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $entity_repository = \Drupal::service('entity.repository');
  }
  $this->entityRepository = $entity_repository;
  if (!$pager_manager) {
    @trigger_error('Calling OverviewTerms::__construct() without the $pager_manager argument is deprecated in drupal:8.8.0 and the $pager_manager argument will be required in drupal:9.0.0. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED);
    $pager_manager = \Drupal::service('pager.manager');
  }
  $this->pagerManager = $pager_manager;
}