i needed a form type that determines based on the bound data if it
should be required or not (to make file upload required if we create
a new entity, but optional when editing the entity with the file.
as this happens in a embedded sonata, i have no way of knowing the actual
data when creating the form in the form builder.
this is what i came up with. horrible of course, but how can this be done
in a sane way?