-
-
Notifications
You must be signed in to change notification settings - Fork 424
New Command: make:document
#1330
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
Conversation
…ne/mongodb-odm-bundle`
Need help with the MongoDB and ext-mongodb PHP extention setup for AppVeyor. |
Fixed AppVeyor |
cc @alcaeus |
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.
I've left some code feedback below.
What I'm completely missing in this PR is support for embedded documents. For one, this should support creating embedded document classes (which use a different document attribute, have no repository, and can be final), as well as creating embedded relationships in the maker itself. Currently the maker assumes all relationships to be references, which isn't true for ODM. In fact, embedded documents are a core concept in MongoDB, and as such I believe they need to be included in the builder for it to be considered.
@alcaeus Thank you for code review and suggestions! Implemented support for embedded documents. When embeding a class that has the |
Sounds good!
The problem is that anything mapped as document can't be embedded, and anything mapped as embedded document can't be stored as root document in a collection. IMO the smartest choice would be to print an error message and suggest an alternative (e.g. a mapped superclass containing common properties, extended by two separate classes that then add the |
Hi there! I think this is a very cool thing. I have avoided reviewing it because... to be fully honest, I don't want to have to maintain all of the code to make this work. I would prefer to have this as a 3rd party, independent bundle and to add any new APIs to MakerBundle to make that possible. I would even be cool with adding a fake Let me know what you think - and sorry for not talking with you about this sooner - it's always very busy. Cheers! |
Howdy @constantable - this looks awesome! But I have to agree with @weaverryan on the maintenance burden this would add to maker-bundle. If you need help on getting this going as a 3rd party bundle, please don't hesitate to create an issue, we'll be glad to help. We love new ideas and the PR's that are created from those ideas, so keep them coming! Thanks... |
@constantable It would be really cool if you could organize your code into a separate maker-bundle package |
New Command:
make:document
to interactively generate document classes fordoctrine/mongodb-odm-bundle
Related issues #320 , #364