Commit 97fc3d31 authored by alexpott's avatar alexpott

Issue #2124537 by chx: Nuke the Eldritch Abomination EntityManager::addNamespaces.

parent fa326794
......@@ -137,27 +137,12 @@ public function __construct(\Traversable $namespaces, ContainerInterface $contai
$this->namespaces = $namespaces;
$this->translationManager = $translation_manager;
$this->doDiscovery($namespaces);
$this->factory = new DefaultFactory($this->discovery);
$this->container = $container;
}
protected function doDiscovery($namespaces) {
$this->discovery = new AnnotatedClassDiscovery('Entity', $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:' . $this->languageManager->getLanguage(Language::TYPE_INTERFACE)->id, 'cache', CacheBackendInterface::CACHE_PERMANENT, array('entity_info' => TRUE));
}
/**
* {@inheritdoc}
*/
public function addNamespaces(\Traversable $namespaces) {
reset($this->namespaces);
$iterator = new \AppendIterator;
$iterator->append(new \IteratorIterator($this->namespaces));
$iterator->append($namespaces);
$this->doDiscovery($iterator);
$this->factory = new DefaultFactory($this->discovery);
$this->container = $container;
}
/**
......
......@@ -138,20 +138,6 @@ public function getControllerClass($entity_type, $controller_type, $nested = NUL
*/
public function getAllBundleInfo();
/**
* Add more namespaces to the entity manager.
*
* This is usually only necessary for uninstall purposes.
*
* @todo Remove this method, along with doDiscovery(), when
* https://drupal.org/node/1199946 is fixed.
*
* @param \Traversable $namespaces
*
* @see comment_uninstall()
*/
public function addNamespaces(\Traversable $namespaces);
/**
* {@inheritdoc}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment