class ExecutionContextFactory

Same name in this branch
  1. 11.x core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php \Drupal\Core\TypedData\Validation\ExecutionContextFactory
Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php \Drupal\Core\TypedData\Validation\ExecutionContextFactory
  2. 8.9.x core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php \Drupal\Core\TypedData\Validation\ExecutionContextFactory
  3. 10 core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php \Drupal\Core\TypedData\Validation\ExecutionContextFactory
  4. 10 core/lib/Drupal/Core/Validation/ExecutionContextFactory.php \Drupal\Core\Validation\ExecutionContextFactory

Defines an execution factory for the Symfony validator.

We do not use the factory provided by Symfony as it is marked internal.

Hierarchy

  • class \Drupal\Core\Validation\ExecutionContextFactory implements \Symfony\Component\Validator\Context\ExecutionContextFactoryInterface

Expanded class hierarchy of ExecutionContextFactory

4 files declare their use of ExecutionContextFactory
ExecutionContextFactory.php in core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php
RecursiveContextualValidatorTest.php in core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
RecursiveValidatorFactory.php in core/modules/file/src/Validation/RecursiveValidatorFactory.php
TypedDataManager.php in core/lib/Drupal/Core/TypedData/TypedDataManager.php

File

core/lib/Drupal/Core/Validation/ExecutionContextFactory.php, line 14

Namespace

Drupal\Core\Validation
View source
class ExecutionContextFactory implements ExecutionContextFactoryInterface {
    
    /**
     * Constructs a new ExecutionContextFactory instance.
     *
     * @param \Drupal\Core\Validation\TranslatorInterface $translator
     *   The translator instance.
     * @param string|null $translationDomain
     *   (optional) The translation domain.
     */
    public function __construct(TranslatorInterface $translator, ?string $translationDomain = NULL) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function createContext(ValidatorInterface $validator, mixed $root) : ExecutionContextInterface {
        return new ExecutionContext($validator, $root, $this->translator, $this->translationDomain);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ExecutionContextFactory::createContext public function
ExecutionContextFactory::__construct public function Constructs a new ExecutionContextFactory instance. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.