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 core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php \Drupal\Core\TypedData\Validation\ExecutionContext::__construct()

Creates a new ExecutionContext.

@internal Called by \Drupal\Core\TypedData\Validation\ExecutionContextFactory. Should not be used in user code.

Parameters

\Symfony\Component\Validator\Validator\ValidatorInterface $validator: The validator.

mixed $root: The root.

\Drupal\Core\Validation\TranslatorInterface $translator: The translator.

string $translationDomain: (optional) The translation domain.

File

core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php, line 128
Contains \Drupal\Core\TypedData\Validation\ExecutionContext.

Class

ExecutionContext
Defines an execution context class.

Namespace

Drupal\Core\TypedData\Validation

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