You are here

class LegacyExecutionContextFactory in Plug 7

Creates new {@link LegacyExecutionContext} instances.

@since 2.5 @author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of LegacyExecutionContextFactory

Deprecated

Implemented for backwards compatibility with Symfony < 2.5. To be removed in Symfony 3.0.

3 files declare their use of LegacyExecutionContextFactory
LegacyValidator2Dot5ApiTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php
LegacyValidatorLegacyApiTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php
ValidatorBuilder.php in lib/Symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php

File

lib/Symfony/validator/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php, line 27

Namespace

Symfony\Component\Validator\Context
View source
class LegacyExecutionContextFactory implements ExecutionContextFactoryInterface {

  /**
   * @var MetadataFactoryInterface
   */
  private $metadataFactory;

  /**
   * @var TranslatorInterface
   */
  private $translator;

  /**
   * @var string|null
   */
  private $translationDomain;

  /**
   * Creates a new context factory.
   *
   * @param MetadataFactoryInterface $metadataFactory   The metadata factory
   * @param TranslatorInterface      $translator        The translator
   * @param string|null              $translationDomain The translation domain
   *                                                    to use for translating
   *                                                    violation messages
   */
  public function __construct(MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null) {
    $this->metadataFactory = $metadataFactory;
    $this->translator = $translator;
    $this->translationDomain = $translationDomain;
  }

  /**
   * {@inheritdoc}
   */
  public function createContext(ValidatorInterface $validator, $root) {
    return new LegacyExecutionContext($validator, $root, $this->metadataFactory, $this->translator, $this->translationDomain);
  }

}

Members