protected function validateConstraints($value,
$cache_key,
$constraints) { foreach ($constraints as $constraint) { // Prevent duplicate validation of constraints, in the case
// that constraints belong to multiple validated groups
if (isset($cache_key)) { $constraint_hash =
spl_object_hash($constraint);
if ($this->context->
isConstraintValidated($cache_key,
$constraint_hash)) { continue;
} $this->context->
markConstraintAsValidated($cache_key,
$constraint_hash);
} $this->context->
setConstraint($constraint);
$validator =
$this->constraintValidatorFactory->
getInstance($constraint);
$validator->
initialize($this->context
);
$validator->
validate($value,
$constraint);
} } /**
* {@inheritdoc}
*/