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

Fixes generate:doctrine:entities errors #4

Merged
merged 1 commit into from
Apr 13, 2012
Merged

Fixes generate:doctrine:entities errors #4

merged 1 commit into from
Apr 13, 2012

Conversation

fixe
Copy link
Contributor

@fixe fixe commented Apr 13, 2012

No description provided.

everzet added a commit that referenced this pull request Apr 13, 2012
Fixes generate:doctrine:entities errors
@everzet everzet merged commit cc01e8c into KnpLabs:master Apr 13, 2012
@hisem
Copy link

hisem commented Oct 29, 2012

When I generate doctrine entities while using a doctrine behavior (timestampable and translatable), i don't get any errors, but I get some once I try doing something else (like generating entities for another entity) :

Runtime Notice: ...Bundle\Entity\Product and Knp\DoctrineBehaviors\Model\Timestampable\Timestampable define the same property ($createdAt) in the composition of ...Bundle\Entity\Product. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in ...Directory/...Bundle/Entity/Product.php line 194

OR

PHP Fatal error: ...Bundle\Entity\ProductTranslation and Knp\DoctrineBehaviors\Model\Translatable\Translation define the same property ($id) in the composition of ...Bundle\Entity\ProductTranslation. However, the definition differs and is considered incompatible. Class was composed in ...Directory/...Bundle/Entity/ProductTranslation.php on line 91

I checked and the fixes that are given here are in my vendor's code, and I updated just to make sure (on dev-master).

Was this fix supposed to handle this error or was it for something else? If so, sorry for using this issue, and :

Am I not supposed to use doctrine:generate:entities on an entity that uses a doctrine behavior, or should I simply delete the unneeded parts that it adds?

Thanks a lot

@docteurklein
Copy link
Contributor

the problem with generate:doctrine:entites is that it does not check if a property is already defined in a trait, and will add it in the composed class.

You will have to manually delete the added code, (theorically, all the things coming from the trait).

@hisem
Copy link

hisem commented Oct 30, 2012

Ok thank you for clearing that up !

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