I have two related fields in a Symfony form: object_status
and cryopreservation_method
.
The first one cannot be null and stores one of three possible choices: liquid
, solid
or cryopreserved
.
The second one should be only set if a record has its object_status
set to 'cryopreserved'
. Otherwise it is NULL
.
How can I check this in the server side (not with Javascript) before saving the form? I have tried to check for null or empty values in model, but with no luck.