Answer the question
In order to leave comments, you need to log in
How to reset a field value in Symfony Validator if it is not valid?
Hello. I use the Symfony validator and Doctrine annotations, inside the dto for its properties I describe the validation rules using annotations.
I want: if the property is expected to be a numeric type and an array came in -> set this property to null, so all properties that do not match the validation requirements will be null, and Exceptions will not be thrown.
How can this be done with the Symfony validator? Moving towards writing your own validator - right?
Thanks in advance for your replies.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question