Constructs a new Entity plugin manager.
\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,
\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this object should use.
public function __construct(\Traversable $namespaces, ContainerInterface $container) {
// Allow the plugin definition to be altered by hook_entity_info_alter().
$annotation_namespaces = array(
'Drupal\\Core\\Entity\\Annotation' => DRUPAL_ROOT . '/core/lib',
);
$this->discovery = new AnnotatedClassDiscovery('Core/Entity', $namespaces, $annotation_namespaces, 'Drupal\\Core\\Entity\\Annotation\\EntityType');
$this->discovery = new InfoHookDecorator($this->discovery, 'entity_info');
$this->discovery = new AlterDecorator($this->discovery, 'entity_info');
$this->discovery = new CacheDecorator($this->discovery, 'entity_info:' . language(Language::TYPE_INTERFACE)->langcode, 'cache', CacheBackendInterface::CACHE_PERMANENT, array(
'entity_info' => TRUE,
));
$this->factory = new DefaultFactory($this->discovery);
$this->container = $container;
}