Constructs a new Entity plugin manager.
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;
}