#1159 - Doctrine\ORM\Repository\DefaultRepositoryFactory
keeps separate caches per entity manager used to build repositories
This commit is contained in:
parent
56378b9bf0
commit
a9847533e5
@ -41,13 +41,13 @@ class DefaultRepositoryFactory implements RepositoryFactory
|
||||
*/
|
||||
public function getRepository(EntityManagerInterface $entityManager, $entityName)
|
||||
{
|
||||
$className = $entityManager->getClassMetadata($entityName)->getName();
|
||||
$repositoryHash = $entityManager->getClassMetadata($entityName)->getName() . spl_object_hash($entityManager);
|
||||
|
||||
if (isset($this->repositoryList[$className])) {
|
||||
return $this->repositoryList[$className];
|
||||
if (isset($this->repositoryList[$repositoryHash])) {
|
||||
return $this->repositoryList[$repositoryHash];
|
||||
}
|
||||
|
||||
return $this->repositoryList[$className] = $this->createRepository($entityManager, $entityName);
|
||||
return $this->repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user