I'm new in Symfony2, so I'm pretty sure this is basic but I can't find the answer on the web,
I have an entity persisted in MySql through Doctrine, all of its properties have their own validation rules in the validation.yml
. When the form is for example a Create/Update form, that's fine: if some rule doesn't match, the proper message pops out in the form noticing the user.
However, what happens when inside a method (let's say a setter) I use an object of another class (a utility, not another entity) for a more complex validation that may throw an exception? Is there a way that its message may be shown like the other validation rules in the form?