Closed
Description
To solve problems like #3622 I propose adding a new constraint named Validate
. The parameters of this constraint are groups
and foreignGroups
.
The constraint validator of Validate
starts a new subvalidation in the same context as the original validation, but uses foreignGroups
:
public function validate($value, Constraint $constraint) {
// ...
$this->context->getValidator()
->inContext($this->context)
->validate($value, null, $constraint->foreignGroups);
}