You are here

private function ExecutionContext::executeConstraintValidators in Plug 7

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

lib/Symfony/validator/Symfony/Component/Validator/ExecutionContext.php, line 270

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);
  }
}