vendor/symfony/src/Symfony/Component/Validator/ValidatorContextInterface.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 <?php
       
     2 
       
     3 namespace Symfony\Component\Validator;
       
     4 
       
     5 /*
       
     6  * This file is part of the Symfony package.
       
     7  *
       
     8  * (c) Fabien Potencier <fabien@symfony.com>
       
     9  *
       
    10  * For the full copyright and license information, please view the LICENSE
       
    11  * file that was distributed with this source code.
       
    12  */
       
    13 
       
    14 use Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface;
       
    15 
       
    16 /**
       
    17  * Stores settings for creating a new validator and creates validators
       
    18  *
       
    19  * The methods in this class are chainable, i.e. they return the context
       
    20  * object itself. When you have finished configuring the new validator, call
       
    21  * getValidator() to create the it.
       
    22  *
       
    23  * <code>
       
    24  * $validator = $context
       
    25  *     ->setClassMetadataFactory($customFactory)
       
    26  *     ->getValidator();
       
    27  * </code>
       
    28  *
       
    29  * @author Bernhard Schussek <bernhard.schussek@symfony.com>
       
    30  */
       
    31 interface ValidatorContextInterface
       
    32 {
       
    33     /**
       
    34      * Sets the class metadata factory used in the new validator
       
    35      *
       
    36      * @param ClassMetadataFactoryInterface $classMetadataFactory The factory instance
       
    37      */
       
    38     function setClassMetadataFactory(ClassMetadataFactoryInterface $classMetadataFactory);
       
    39 
       
    40     /**
       
    41      * Sets the constraint validator factory used in the new validator
       
    42      *
       
    43      * @param ConstraintValidatorFactoryInterface $constraintValidatorFactory The factory instance
       
    44      */
       
    45     function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $constraintValidatorFactory);
       
    46 
       
    47     /**
       
    48      * Creates a new validator with the settings stored in this context
       
    49      *
       
    50      * @return ValidatorInterface   The new validator
       
    51      */
       
    52     function getValidator();
       
    53 }