function TypeLinkManager::__construct

Same name in other branches
  1. 9 core/modules/hal/src/LinkManager/TypeLinkManager.php \Drupal\hal\LinkManager\TypeLinkManager::__construct()

Constructor.

Parameters

\Drupal\Core\Cache\CacheBackendInterface $cache: The injected cache backend for caching type URIs.

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

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

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info_service: The bundle info service.

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

File

core/modules/hal/src/LinkManager/TypeLinkManager.php, line 67

Class

TypeLinkManager

Namespace

Drupal\hal\LinkManager

Code

public function __construct(CacheBackendInterface $cache, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack, EntityTypeBundleInfoInterface $bundle_info_service, EntityTypeManagerInterface $entity_type_manager = NULL) {
    $this->cache = $cache;
    $this->configFactory = $config_factory;
    $this->moduleHandler = $module_handler;
    $this->requestStack = $request_stack;
    $this->bundleInfoService = $bundle_info_service;
    if (!$entity_type_manager) {
        @trigger_error('The entity_type.manager service must be passed to TypeLinkManager::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
        $entity_type_manager = \Drupal::service('entity_type.manager.manager');
    }
    $this->entityTypeManager = $entity_type_manager;
}

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