-
Notifications
You must be signed in to change notification settings - Fork 10
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
Integration with symfony #11
Comments
In my opinion, you can use a trait for situations such this. After pairing the embeddable to owning entity, you can utilize a trait for setter and getters of value object. Right now, this repository have not any trait implementation, please don't hesitate to give opinion if there is any other solution or way to deal with. @muspelheim |
@muspelheim thanks for your interest. Seems like your case is related with object hydration and imho there is nothing to do within this library except allowing empty values in constructors. After your comment I realized this detail and I will try to create another PR to convert all ctors args to optional. Another detail is, reason behind existence of the As you know there is no method overloading in PHP, but if you don't want to create a custom hydrator for your
Yes, it looks ugly and I also prefer to have type hinting here but don't know is there is a better approach exists or not. |
* Improve Goepoint, add more and proper tests * Allow empty state for all value objects #11 #12 * Fixing some grammar @yasinaydin * update for contributing message (#13) @hkulekci
All embeddables now supports empty state. Closing this. Hydration of domain entities should be handled in other application layers. |
Hello, I trying integrate this bundle with symfony, but it's not work for me.
This I add to my entity, after run command bin/console doctrine:generate:entities I get this result:
In this case we can't create simple object as:
Because method setEmail must be an instance of EmailAddress, string given and it's useless for development. In this case we can manually create method
but this solution is very difficult to extend, may be you have solution for this case?
this case is difficult for development.
The text was updated successfully, but these errors were encountered: