-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] 'em' option in entity form type #4125
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
Comments
Passing the EntityManager itself is not a big use case as you will not have access to it anyway as soon as you nest types in a complex form, except by adding the option in all your parent types (which was needed in Symfony beta1 before the change to use the name, making it a pain to use a non-default manager). However, using |
And it should be done in DoctrineType directly to avoid duplicating the logic in each Doctrine bundle |
@JRFISH Do you want to work on a PR for this improvement? |
@asm89 yes i will make a PR |
Commits ------- 17ca9b6 [Form] Fixed DoctrineType to use getManagerForClass() if no EM name is given Discussion ---------- [Form] Fixed DoctrineType to use getManagerForClass() if no EM name is given Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: #4125 Todo: - --------------------------------------------------------------------------- by stof at 2012-07-17T08:16:59Z :+1:
in
the 'class' option is mandatory. if the class is managed by a non-default entity manager, then also an 'em' option must be set. and it takes a string entity manager name.
current behavior is if 'em' is omitted, default em is used. but since the class is specified, the 'em' should be get from
also would be nice if not only string, but also
Doctrine\Common\Persistence\ObjectManager
can be passed here.The text was updated successfully, but these errors were encountered: