public function EntityManager::__construct

Constructs a new Entity plugin manager.

File

drupal/core/lib/Drupal/Core/Entity/EntityManager.php, line 230
Contains \Drupal\Core\Entity\EntityManager.

Class

EntityManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

public function __construct() {

  // Allow the plugin definition to be altered by hook_entity_info_alter().
  $this->discovery = new AnnotatedClassDiscovery('Core', 'Entity');
  $this->discovery = new InfoHookDecorator($this->discovery, 'entity_info');
  $this->discovery = new AlterDecorator($this->discovery, 'entity_info');

  // @todo Run process before altering, see http://drupal.org/node/1848964.
  $this->discovery = new ProcessDecorator($this->discovery, array(
    $this,
    'processDefinition',
  ));
  $this->factory = new DefaultFactory($this);

  // Entity type plugins includes translated strings, so each language is
  // cached separately.
  $this->cacheKey .= ':' . language(LANGUAGE_TYPE_INTERFACE)->langcode;
}