EntityTypeManager::__construct

public EntityTypeManager::__construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, TranslationInterface $string_translation, ClassResolverInterface $class_resolver)

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.

Overrides DefaultPluginManager::__construct

File

core/lib/Drupal/Core/Entity/EntityTypeManager.php, line 76

Class

EntityTypeManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, TranslationInterface $string_translation, ClassResolverInterface $class_resolver) {
  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;
}
doc_Drupal
2016-10-29 09:08:37
Comments
Leave a Comment

Please login to continue.