Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonata Admin how to read not mapped field?

I added fields with the option "mapped" => false to a SonataAdmin form.

Now I need to access the values of the form fields marked with "mapped" => false in the method postUpdate. How can I retrieve them?

like image 828
Olindo Pindaro Avatar asked Dec 07 '13 11:12

Olindo Pindaro


1 Answers

You can simply get Form and filed data in your admin class. In method postUpdate:

$fieldData = $this->getForm()->get('name_of_field')->getData();
like image 177
Petr Slavicek Avatar answered Oct 31 '22 10:10

Petr Slavicek