When you need extra manipulations to object data population in form (for example, you need to resolve whether is entered user email is already registered and put existing user object or it needs to create a new user), you might want to set data_class with closure, but there isn't such option.
The right way is to use https://symfony.com/doc/4.4/form/data_mappers.html Data Mappers
Комментариев нет:
Отправить комментарий