You are here

private function ExecutionContext::executeConstraintValidators in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/ExecutionContext.php \Symfony\Component\Validator\ExecutionContext::executeConstraintValidators()

Executes the validators of the given constraints for the given value.

Parameters

mixed $value The value to validate.:

Constraint[] $constraints The constraints to match against.:

File

vendor/symfony/validator/ExecutionContext.php, line 272

Class

ExecutionContext
Default implementation of {@link ExecutionContextInterface}.

Namespace

Symfony\Component\Validator

Code

private function executeConstraintValidators($value, array $constraints) {
  foreach ($constraints as $constraint) {
    $validator = $this->globalContext
      ->getValidatorFactory()
      ->getInstance($constraint);
    $validator
      ->initialize($this);
    $validator
      ->validate($value, $constraint);
  }
}