Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 146 lines (129 sloc) 4.351 kb
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
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 Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface;
15 use Symfony\Component\Validator\Mapping\Cache\CacheInterface;
9b3f340f » webmozart
2012-07-30 [Form] [Validator] Fixed issues mentioned in the PR
16 use Doctrine\Common\Annotations\Reader;
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
17
18 /**
19 * A configurable builder for ValidatorInterface objects.
20 *
21 * @author Bernhard Schussek <bschussek@gmail.com>
22 */
23 interface ValidatorBuilderInterface
24 {
25 /**
26 * Adds an object initializer to the validator.
27 *
28 * @param ObjectInitializerInterface $initializer The initializer.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
29 *
30 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
31 */
32 public function addObjectInitializer(ObjectInitializerInterface $initializer);
33
34 /**
35 * Adds a list of object initializers to the validator.
36 *
37 * @param array $initializers The initializer.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
38 *
39 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
40 */
41 public function addObjectInitializers(array $initializers);
42
43 /**
44 * Adds an XML constraint mapping file to the validator.
45 *
46 * @param string $path The path to the mapping file.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
47 *
48 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
49 */
50 public function addXmlMapping($path);
51
52 /**
53 * Adds a list of XML constraint mapping files to the validator.
54 *
55 * @param array $paths The paths to the mapping files.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
56 *
57 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
58 */
59 public function addXmlMappings(array $paths);
60
61 /**
62 * Adds a YAML constraint mapping file to the validator.
63 *
64 * @param string $path The path to the mapping file.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
65 *
66 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
67 */
68 public function addYamlMapping($path);
69
70 /**
71 * Adds a list of YAML constraint mappings file to the validator.
72 *
73 * @param array $paths The paths to the mapping files.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
74 *
75 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
76 */
77 public function addYamlMappings(array $paths);
78
79 /**
80 * Enables constraint mapping using the given static method.
81 *
82 * @param string $methodName The name of the method.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
83 *
84 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
85 */
86 public function addMethodMapping($methodName);
87
88 /**
89 * Enables constraint mapping using the given static methods.
90 *
91 * @param array $methodNames The names of the methods.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
92 *
93 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
94 */
95 public function addMethodMappings(array $methodNames);
96
97 /**
9b3f340f » webmozart
2012-07-30 [Form] [Validator] Fixed issues mentioned in the PR
98 * Enables annotation based constraint mapping.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
99 *
9b3f340f » webmozart
2012-07-30 [Form] [Validator] Fixed issues mentioned in the PR
100 * @param Reader $annotationReader The annotation reader to be used.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
101 *
102 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
103 */
9b3f340f » webmozart
2012-07-30 [Form] [Validator] Fixed issues mentioned in the PR
104 public function enableAnnotationMapping(Reader $annotationReader = null);
105
106 /**
107 * Disables annotation based constraint mapping.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
108 *
109 * @return ValidatorBuilderInterface The builder object.
9b3f340f » webmozart
2012-07-30 [Form] [Validator] Fixed issues mentioned in the PR
110 */
111 public function disableAnnotationMapping();
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
112
113 /**
114 * Sets the class metadata factory used by the validator.
115 *
116 * @param ClassMetadataFactoryInterface $metadataFactory The metadata factory.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
117 *
118 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
119 */
120 public function setMetadataFactory(ClassMetadataFactoryInterface $metadataFactory);
121
122 /**
123 * Sets the cache for caching class metadata.
124 *
125 * @param CacheInterface $cache The cache instance.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
126 *
127 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
128 */
129 public function setMetadataCache(CacheInterface $cache);
130
131 /**
132 * Sets the constraint validator factory used by the validator.
133 *
134 * @param ConstraintValidatorFactoryInterface $validatorFactory The validator factory.
6bb95d8c » meandmymonkey
2012-08-23 updated docblocks for ValidatorBuilderInterface
135 *
136 * @return ValidatorBuilderInterface The builder object.
19695e96 » webmozart
2012-07-30 [Validator] Added entry point "Validation" for more convenient usage …
137 */
138 public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory);
139
140 /**
141 * Builds and returns a new validator object.
142 *
143 * @return ValidatorInterface The built validator.
144 */
145 public function getValidator();
146 }
Something went wrong with that request. Please try again.