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
Updated the EntityGenerator to be compatible with Common 3.0.x #61
Conversation
The Use Statement alias has to be variable as well, as the annotation prefix can be changed from ORM\ to something else. |
@@ -293,13 +302,16 @@ public function <methodName>() | |||
*/ | |||
public function setAnnotationPrefix($prefix) | |||
{ | |||
if (version_compare(\Doctrine\Common\Version::VERSION, '3.0.0-DEV', '>=')) { |
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.
erm? This is pretty Symfony centered change. You should be able to change this.
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.
Well, when using 3.0.x, the prefix does not make sense (as there is no prefix) and should stay ORM\
as the use statement is use Doctrine\ORM\Mapping as ORM
to avoid having to put a use statement for each annotation used in the class.
Updated the EntityGenerator to be compatible with Common 3.0.x
This should also be merged with 2.0.x. As soon as this PR makes it into 2.0.x, what about releasing a new version of Doctrine 2.0? Without it, some Doctrine commands are broken for Symfony and this prevents me to release Symfony 2.0RC1. Thanks. |
Why dont you raise dependency to 2.1? It will be released end of june. I dont want to merge this into 2.0.x, Configuration::newDefaultannotationDriver does not support Common 3 aswell, no parts of the 2.0 code do. |
I vote +1 to bump the dependency to 2.1 Doctrine 2.1 comes with useful features (binding a parameter as array for instance) and keeping the compatibility with 2.0.x in all bundles can become a pain |
+1 |
Cookbook article: Advanced field value conversion using custom mapping types
This updates the EntityGenerator to work with Common 3.0.x by importing the annotation namespace as
ORM
and prefixing all entities withORM\
. The use statement is added in all cases to keep the code simple as it does not hurt on older versions of Common.