You are here

public function ExecutionContext::__construct in Plug 7

Same name in this branch
  1. 7 lib/Symfony/validator/Symfony/Component/Validator/ExecutionContext.php \Symfony\Component\Validator\ExecutionContext::__construct()
  2. 7 lib/Symfony/validator/Symfony/Component/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 lib/Symfony/validator/Symfony/Component/Validator/Context/LegacyExecutionContext.php
Creates a new context.
1 method overrides ExecutionContext::__construct()
LegacyExecutionContext::__construct in lib/Symfony/validator/Symfony/Component/Validator/Context/LegacyExecutionContext.php
Creates a new context.

File

lib/Symfony/validator/Symfony/Component/Validator/Context/ExecutionContext.php, line 145

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