Olindo Pindaro
Olindo Pindaro

Reputation: 115

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?

Upvotes: 9

Views: 6506

Answers (1)

Petr Slavicek
Petr Slavicek

Reputation: 456

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

$fieldData = $this->getForm()->get('name_of_field')->getData();

Upvotes: 17

Related Questions