I have a custom validator and I would like to access the entire entity from the validator.
I have found Class Constraint Validator http://symfony.com/doc/current/cookbook/validation/custom_constraint.html#class-constraint-validator but I don't know how to use it.
Where to setup the validator, for the moment I have it like that:
$metadata->addPropertyConstraint('doi', new IsDOI());
But this si only for the parameter, not for the entire class. I can't really understand the symfony example.