function RelationLinkManager::__construct
Same name in other branches
- 9 core/modules/hal/src/LinkManager/RelationLinkManager.php \Drupal\hal\LinkManager\RelationLinkManager::__construct()
Constructor.
Parameters
\Drupal\Core\Cache\CacheBackendInterface $cache: The cache of relation URIs and their associated Typed Data IDs.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\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 $entity_type_bundle_info: The entity type bundle info.
\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.
File
-
core/
modules/ hal/ src/ LinkManager/ RelationLinkManager.php, line 75
Class
Namespace
Drupal\hal\LinkManagerCode
public function __construct(CacheBackendInterface $cache, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, EntityFieldManagerInterface $entity_field_manager = NULL) {
$this->cache = $cache;
$this->entityTypeManager = $entity_type_manager;
if (!$entity_type_bundle_info) {
@trigger_error('The entity_type.bundle.info service must be passed to RelationLinkManager::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
$entity_type_bundle_info = \Drupal::service('entity_type.bundle.info');
}
$this->entityTypeBundleInfo = $entity_type_bundle_info;
if (!$entity_field_manager) {
@trigger_error('The entity_field.manager service must be passed to RelationLinkManager::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
$entity_field_manager = \Drupal::service('entity_field.manager');
}
$this->entityFieldManager = $entity_field_manager;
$this->configFactory = $config_factory;
$this->moduleHandler = $module_handler;
$this->requestStack = $request_stack;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.