You are here

public function RecursiveContextualValidator::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Validator/RecursiveContextualValidator.php \Symfony\Component\Validator\Validator\RecursiveContextualValidator::__construct()
  2. 8 core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php \Drupal\Core\TypedData\Validation\RecursiveContextualValidator::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Validator/RecursiveContextualValidator.php \Symfony\Component\Validator\Validator\RecursiveContextualValidator::__construct()

Creates a validator for the given context.

Parameters

ExecutionContextInterface $context The execution context:

MetadataFactoryInterface $metadataFactory The factory for: fetching the metadata of validated objects

ConstraintValidatorFactoryInterface $validatorFactory The factory for creating: constraint validators

ObjectInitializerInterface[] $objectInitializers The object initializers:

File

vendor/symfony/validator/Validator/RecursiveContextualValidator.php, line 83

Class

RecursiveContextualValidator
Recursive implementation of {@link ContextualValidatorInterface}.

Namespace

Symfony\Component\Validator\Validator

Code

public function __construct(ExecutionContextInterface $context, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = array()) {
  $this->context = $context;
  $this->defaultPropertyPath = $context
    ->getPropertyPath();
  $this->defaultGroups = array(
    $context
      ->getGroup() ?: Constraint::DEFAULT_GROUP,
  );
  $this->metadataFactory = $metadataFactory;
  $this->validatorFactory = $validatorFactory;
  $this->objectInitializers = $objectInitializers;
}