annotate vendor/symfony/validator/ValidatorBuilderInterface.php @ 0:4c8ae668cc8c

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