You are here

final class Validation in Plug 7

Entry point for the Validator component.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of Validation

135 files declare their use of Validation
AbstractConstraintValidatorTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php
AllValidatorTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php
BlankValidatorTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php
CallbackValidatorTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php
CardSchemeValidatorTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php

... See full list

File

lib/Symfony/validator/Symfony/Component/Validator/Validation.php, line 19

Namespace

Symfony\Component\Validator
View source
final class Validation {

  /**
   * The Validator API provided by Symfony 2.4 and older.
   */
  const API_VERSION_2_4 = 1;

  /**
   * The Validator API provided by Symfony 2.5 and newer.
   */
  const API_VERSION_2_5 = 2;

  /**
   * The Validator API provided by Symfony 2.5 and newer with a backwards
   * compatibility layer for 2.4 and older.
   */
  const API_VERSION_2_5_BC = 3;

  /**
   * Creates a new validator.
   *
   * If you want to configure the validator, use
   * {@link createValidatorBuilder()} instead.
   *
   * @return ValidatorInterface The new validator.
   */
  public static function createValidator() {
    return self::createValidatorBuilder()
      ->getValidator();
  }

  /**
   * Creates a configurable builder for validator objects.
   *
   * @return ValidatorBuilderInterface The new builder.
   */
  public static function createValidatorBuilder() {
    return new ValidatorBuilder();
  }

  /**
   * This class cannot be instantiated.
   */
  private function __construct() {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Validation::API_VERSION_2_4 constant The Validator API provided by Symfony 2.4 and older.
Validation::API_VERSION_2_5 constant The Validator API provided by Symfony 2.5 and newer.
Validation::API_VERSION_2_5_BC constant The Validator API provided by Symfony 2.5 and newer with a backwards compatibility layer for 2.4 and older.
Validation::createValidator public static function Creates a new validator.
Validation::createValidatorBuilder public static function Creates a configurable builder for validator objects.
Validation::__construct private function This class cannot be instantiated.