function EntityTypeManager::__construct
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::__construct()
- 10 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::__construct()
- 11.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::__construct()
Constructs a new Entity plugin manager.
Parameters
\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend to use.
\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation.
\Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver: The class resolver.
\Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository: The entity last installed schema repository.
Overrides DefaultPluginManager::__construct
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php, line 85
Class
- EntityTypeManager
- Manages entity type plugin definitions.
Namespace
Drupal\Core\EntityCode
public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, TranslationInterface $string_translation, ClassResolverInterface $class_resolver, EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository) {
parent::__construct('Entity', $namespaces, $module_handler, 'Drupal\\Core\\Entity\\EntityInterface');
$this->setCacheBackend($cache, 'entity_type', [
'entity_types',
]);
$this->alterInfo('entity_type');
$this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, 'Drupal\\Core\\Entity\\Annotation\\EntityType');
$this->stringTranslation = $string_translation;
$this->classResolver = $class_resolver;
$this->entityLastInstalledSchemaRepository = $entity_last_installed_schema_repository;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.