Skip to content
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

Merged
merged 1 commit into from Jun 11, 2011

Conversation

stof
Copy link
Member

@stof stof commented May 25, 2011

This updates the EntityGenerator to work with Common 3.0.x by importing the annotation namespace as ORM and prefixing all entities with ORM\. The use statement is added in all cases to keep the code simple as it does not hurt on older versions of Common.

@beberlei
Copy link
Member

beberlei commented Jun 5, 2011

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', '>=')) {
Copy link
Member

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.

Copy link
Member Author

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.

beberlei added a commit that referenced this pull request Jun 11, 2011
Updated the EntityGenerator to be compatible with Common 3.0.x
@beberlei beberlei merged commit 9945296 into doctrine:master Jun 11, 2011
@fabpot
Copy link
Member

fabpot commented Jun 13, 2011

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.

@beberlei
Copy link
Member

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.

@stof
Copy link
Member Author

stof commented Jun 15, 2011

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

@lsmith77
Copy link
Member

+1

beberlei added a commit that referenced this pull request Jan 23, 2013
Cookbook article: Advanced field value conversion using custom mapping types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants