You are here

public function ExecutionContext::__construct in Zircon Profile 8

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

Creates a new execution context.

@internal Called by {@link ExecutionContextFactory}. Should not be used in user code.

Parameters

ValidatorInterface $validator The validator:

mixed $root The root value of the: validated object graph

TranslatorInterface $translator The translator:

string|null $translationDomain The translation domain to: use for translating violation messages

1 call to ExecutionContext::__construct()
LegacyExecutionContext::__construct in vendor/symfony/validator/Context/LegacyExecutionContext.php
Creates a new context.
1 method overrides ExecutionContext::__construct()
LegacyExecutionContext::__construct in vendor/symfony/validator/Context/LegacyExecutionContext.php
Creates a new context.

File

vendor/symfony/validator/Context/ExecutionContext.php, line 147

Class

ExecutionContext
The context used and created by {@link ExecutionContextFactory}.

Namespace

Symfony\Component\Validator\Context

Code

public function __construct(ValidatorInterface $validator, $root, TranslatorInterface $translator, $translationDomain = null) {
  $this->validator = $validator;
  $this->root = $root;
  $this->translator = $translator;
  $this->translationDomain = $translationDomain;
  $this->violations = new ConstraintViolationList();
}