Answer the question
In order to leave comments, you need to log in
Sonata FormMapper how to execute arbitrary code before saving to database?
I build the form according to its essence using the FormMapper, it saves everything to the database well, it works fine, but it is necessary to display several arbitrary fields on the form (I figured it out), and then, when submitting data from the form, before sending the information to the database, pick up the values of these fields and perform manipulations.
How to do it correctly in sonata? I would be grateful either for an example, or for a good link.
Answer the question
In order to leave comments, you need to log in
This can be done in the prePersist function in the admin class:
sonata-project.org/bundles/admin/master/doc/refere...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question