You are here

public function RecursiveContextualValidator::__construct in Plug 7

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

lib/Symfony/validator/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php, line 73

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