-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DefaultRepositoryFactory: single repository for aliased entities #1112
DefaultRepositoryFactory: single repository for aliased entities #1112
Conversation
$this->repositoryList[$class] = $repository; | ||
|
||
if ($class !== $entityName) { | ||
$this->repositoryList[$entityName] = &$this->repositoryList[$class]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to assign it by reference. It is an object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've entered paranoid-mode :) fixed it!
@stof maybe you mean line 50? I've left the original |
Ok, @Ocramius . I've updated the commit. |
@giosh94mhz checking out locally and merging, thanks! |
The actual implementation of
DefaultRepositoryFactory
create multiple instances for a single entity if is accessed by multiple namespace aliases.I've patched
DefaultRepositoryFactory::getRepository
so that aliases are resolved before saving the reference into therepositoryList
.Just to not affect performance of existing implementation, I've added to therepositoryList
both the aliased class name and the fully-qualified class name, but only the latter is required.