function 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.
\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container.
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, protected ContainerInterface $container) {
parent::__construct('Entity', $namespaces, $module_handler, EntityInterface::class);
$this->setCacheBackend($cache, 'entity_type', [
'entity_types',
]);
$this->alterInfo('entity_type');
$this->discovery = new AttributeDiscoveryWithAnnotations($this->subdir, $this->namespaces, EntityType::class, '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.