function EntityConverter::__construct

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/ParamConverter/EntityConverter.php \Drupal\Core\ParamConverter\EntityConverter::__construct()
  2. 10 core/lib/Drupal/Core/ParamConverter/EntityConverter.php \Drupal\Core\ParamConverter\EntityConverter::__construct()
  3. 11.x core/lib/Drupal/Core/ParamConverter/EntityConverter.php \Drupal\Core\ParamConverter\EntityConverter::__construct()

Constructs a new EntityConverter.

Parameters

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

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

See also

https://www.drupal.org/node/2938929

1 call to EntityConverter::__construct()
AdminPathConfigEntityConverter::__construct in core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php
Constructs a new EntityConverter.
1 method overrides EntityConverter::__construct()
AdminPathConfigEntityConverter::__construct in core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php
Constructs a new EntityConverter.

File

core/lib/Drupal/Core/ParamConverter/EntityConverter.php, line 109

Class

EntityConverter
Parameter converter for upcasting entity IDs to full objects.

Namespace

Drupal\Core\ParamConverter

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityRepositoryInterface $entity_repository) {
    $this->entityTypeManager = $entity_type_manager;
    $this->entityRepository = $entity_repository;
}

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