Fix bug in style changes for the Use cases on the live site.
[yaffs-website] / vendor / symfony / validator / ValidatorBuilderInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator;
13
14 use Doctrine\Common\Annotations\Reader;
15 use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
16 use Symfony\Component\Translation\TranslatorInterface;
17 use Symfony\Component\Validator\Mapping\Cache\CacheInterface;
18
19 /**
20  * A configurable builder for ValidatorInterface objects.
21  *
22  * @author Bernhard Schussek <bschussek@gmail.com>
23  */
24 interface ValidatorBuilderInterface
25 {
26     /**
27      * Adds an object initializer to the validator.
28      *
29      * @param ObjectInitializerInterface $initializer The initializer
30      *
31      * @return $this
32      */
33     public function addObjectInitializer(ObjectInitializerInterface $initializer);
34
35     /**
36      * Adds a list of object initializers to the validator.
37      *
38      * @param array $initializers The initializer
39      *
40      * @return $this
41      */
42     public function addObjectInitializers(array $initializers);
43
44     /**
45      * Adds an XML constraint mapping file to the validator.
46      *
47      * @param string $path The path to the mapping file
48      *
49      * @return $this
50      */
51     public function addXmlMapping($path);
52
53     /**
54      * Adds a list of XML constraint mapping files to the validator.
55      *
56      * @param array $paths The paths to the mapping files
57      *
58      * @return $this
59      */
60     public function addXmlMappings(array $paths);
61
62     /**
63      * Adds a YAML constraint mapping file to the validator.
64      *
65      * @param string $path The path to the mapping file
66      *
67      * @return $this
68      */
69     public function addYamlMapping($path);
70
71     /**
72      * Adds a list of YAML constraint mappings file to the validator.
73      *
74      * @param array $paths The paths to the mapping files
75      *
76      * @return $this
77      */
78     public function addYamlMappings(array $paths);
79
80     /**
81      * Enables constraint mapping using the given static method.
82      *
83      * @param string $methodName The name of the method
84      *
85      * @return $this
86      */
87     public function addMethodMapping($methodName);
88
89     /**
90      * Enables constraint mapping using the given static methods.
91      *
92      * @param array $methodNames The names of the methods
93      *
94      * @return $this
95      */
96     public function addMethodMappings(array $methodNames);
97
98     /**
99      * Enables annotation based constraint mapping.
100      *
101      * @param Reader $annotationReader The annotation reader to be used
102      *
103      * @return $this
104      */
105     public function enableAnnotationMapping(Reader $annotationReader = null);
106
107     /**
108      * Disables annotation based constraint mapping.
109      *
110      * @return $this
111      */
112     public function disableAnnotationMapping();
113
114     /**
115      * Sets the class metadata factory used by the validator.
116      *
117      * @param MetadataFactoryInterface $metadataFactory The metadata factory
118      *
119      * @return $this
120      */
121     public function setMetadataFactory(MetadataFactoryInterface $metadataFactory);
122
123     /**
124      * Sets the cache for caching class metadata.
125      *
126      * @param CacheInterface $cache The cache instance
127      *
128      * @return $this
129      */
130     public function setMetadataCache(CacheInterface $cache);
131
132     /**
133      * Sets the constraint validator factory used by the validator.
134      *
135      * @param ConstraintValidatorFactoryInterface $validatorFactory The validator factory
136      *
137      * @return $this
138      */
139     public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory);
140
141     /**
142      * Sets the translator used for translating violation messages.
143      *
144      * @param TranslatorInterface $translator The translator instance
145      *
146      * @return $this
147      */
148     public function setTranslator(TranslatorInterface $translator);
149
150     /**
151      * Sets the default translation domain of violation messages.
152      *
153      * The same message can have different translations in different domains.
154      * Pass the domain that is used for violation messages by default to this
155      * method.
156      *
157      * @param string $translationDomain The translation domain of the violation messages
158      *
159      * @return $this
160      */
161     public function setTranslationDomain($translationDomain);
162
163     /**
164      * Sets the property accessor for resolving property paths.
165      *
166      * @param PropertyAccessorInterface $propertyAccessor The property accessor
167      *
168      * @return $this
169      *
170      * @deprecated since version 2.5, to be removed in 3.0.
171      */
172     public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor);
173
174     /**
175      * Sets the API version that the returned validator should support.
176      *
177      * @param int $apiVersion The required API version
178      *
179      * @return $this
180      *
181      * @see Validation::API_VERSION_2_5
182      * @see Validation::API_VERSION_2_5_BC
183      * @deprecated since version 2.7, to be removed in 3.0.
184      */
185     public function setApiVersion($apiVersion);
186
187     /**
188      * Builds and returns a new validator object.
189      *
190      * @return ValidatorInterface The built validator
191      */
192     public function getValidator();
193 }