You are here

public function ListUsageController::__construct in Entity Usage 8.2

Same name and namespace in other branches
  1. 8.4 src/Controller/ListUsageController.php \Drupal\entity_usage\Controller\ListUsageController::__construct()
  2. 8 src/Controller/ListUsageController.php \Drupal\entity_usage\Controller\ListUsageController::__construct()
  3. 8.3 src/Controller/ListUsageController.php \Drupal\entity_usage\Controller\ListUsageController::__construct()

ListUsageController constructor.

Parameters

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

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.

\Drupal\entity_usage\EntityUsageInterface $entity_usage: The EntityUsage service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.

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

File

src/Controller/ListUsageController.php, line 85

Class

ListUsageController
Controller for our pages.

Namespace

Drupal\entity_usage\Controller

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, EntityUsageInterface $entity_usage, ConfigFactoryInterface $config_factory, PagerManagerInterface $pager_manager) {
  $this->entityTypeManager = $entity_type_manager;
  $this->entityFieldManager = $entity_field_manager;
  $this->entityUsage = $entity_usage;
  $this->entityUsageConfig = $config_factory
    ->get('entity_usage.settings');
  $this->itemsPerPage = $this->entityUsageConfig
    ->get('usage_controller_items_per_page') ?: self::ITEMS_PER_PAGE_DEFAULT;
  $this->pagerManager = $pager_manager;
}