Skip to content
Snippets Groups Projects
Commit 97fc3d31 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent fa326794
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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}
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment