-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Duplication of generated methods / attributes with Traits #297
Comments
Can you share the mapping (presumably it was XML or YML) that resulted in this generated code? I'd like to try and reproduce it. Although |
The mapping was with annotations. A sample mapping is there: https://github.com/khepin/DoctrineMongoDuplicateGetSet/tree/master/src/Acme/DemoBundle/Document After getting the project file if you run composer and then |
I just installed PHP 5.4 on my local machine, so I should be able to reproduce this soon and work on a fix. |
@jmikola I know that the ORM fixed some bugs about inherited methods from parent classes too a while ago. Not sure if it was applied to the ODM DocumentGenerator. It may be related |
I encounter this issue as well - proxy generation ignores traits, and therefor my "getId" method didn't returned the id lazy, but rather filled the entire referenced document' properties. Any updates on the fix of it ? |
Just to cross reference, proxy issue is reported in doctrine/common#337 As for the original generator issue I've found two related PRs in ORM:
I'll look into porting this solution into ODM |
When a class is set to use a given trait as for example the one provided by
DoctrineExtensions,
the properties and methods defined in the trait file are re-created in the file
defining the class even though they already exist in the Trait definition.
For example here's what I get for a comment thread class in a SF project if I use
the
doctrine:mongodb:generate:documents
command:The text was updated successfully, but these errors were encountered: