-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Added the support of namespace alias in getManagerForClass #166
Conversation
Is there a test for this? |
There is no test at all for the abstract registry |
Btw, the logic is the same than in the AbstractClassMetadataFactory |
@@ -190,6 +190,12 @@ public function getManager($name = null) | |||
*/ | |||
public function getManagerForClass($class) | |||
{ | |||
// Check for namespace alias |
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.
@stof the abstract class metadata factory already handles this (see https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php#L346 )
So this and the block can simply be removed. Not sure about the one using ReflectionClass
, since isTransitient
is quite simple.
Also, if you call $this->getAliasNamespace()
you have at least to define it as abstract method.
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 it cannot be removed. See the line just after this creating a ReflectionClass and the issue linked in the description.
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.
and I don't need to define the method as abstract: the interface already does it
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.
This happens when I'm too lazy to browse :)
Maybe you can still add a test (even if we do not have one on this yet). |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Added the support of namespace alias in getManagerForClass
See doctrine/DoctrineBundle#95
@beberlei it would be great to have it in the 2.3 branch at least, otherwise I will have to overwrite the method in the Symfony bridge to avoid a regression due to the change in the DoctrineType.