-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Annotation support for Validator and DoctrineEntity element #69
Comments
You'd build a new annotation builder. Specifying the entity manager to be used later on would be wrong. |
What ? There is already a specific annotation builder in DoctrineORMModule :). |
Yes, but if you need a second EntityManager it is up to you to configure it with that, no? |
I don't want a second one. I just want one =). |
So you basically want a |
Hmmm. Did you used the annotation form ? In fact, the NoEntityExists (as well as DoctrineORMModule\Form\Element\DoctrineEntity) needs an entity manager to work (otherwise they throw an exception). However when using annotation, you cannot give instance to an option. BUT the Annotation builder in DoctrineORMModule (DoctrineORMModule\Form\Annotation\AnnotationBuilder) has an instance of the em. As this object checks every annotation to construct the form, it should be able to automatically inject the em to elements/validators that need it. |
No, I didn't use the annotation builder, but the validators are something different from the builder itself. This anyway seems more like a job for the |
Closing. This should be (imo) handled through metadata instead. Please re-open if you got better ideas to fix this, but I'd really move away from the concept of annotations and instead have a builder instantiated with an |
[Hydrator] Allow hydration of existing objects
Currently, when using Form annotation, there are no ways to specify the entity manager for Validator and DoctrineEntity Form elements. As the annotation builder has the em, I think it could be automatically injected ?
The text was updated successfully, but these errors were encountered: