class ValidatorBuilder implements ValidatorBuilderInterface
The default implementation of {@link ValidatorBuilderInterface}.
$this | addObjectInitializer(ObjectInitializerInterface $initializer) Adds an object initializer to the validator. | |
$this | addObjectInitializers(array $initializers) Adds a list of object initializers to the validator. | |
$this | addXmlMapping(string $path) Adds an XML constraint mapping file to the validator. | |
$this | addXmlMappings(array $paths) Adds a list of XML constraint mapping files to the validator. | |
$this | addYamlMapping(string $path) Adds a YAML constraint mapping file to the validator. | |
$this | addYamlMappings(array $paths) Adds a list of YAML constraint mappings file to the validator. | |
$this | addMethodMapping(string $methodName) Enables constraint mapping using the given static method. | |
$this | addMethodMappings(array $methodNames) Enables constraint mapping using the given static methods. | |
$this | enableAnnotationMapping(Reader $annotationReader = null) Enables annotation based constraint mapping. | |
$this | disableAnnotationMapping() Disables annotation based constraint mapping. | |
$this | setMetadataFactory(MetadataFactoryInterface $metadataFactory) Sets the class metadata factory used by the validator. | |
$this | setMetadataCache(CacheInterface $cache) Sets the cache for caching class metadata. | |
$this | setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory) Sets the constraint validator factory used by the validator. | |
$this | setTranslator(TranslatorInterface $translator) Sets the translator used for translating violation messages. | |
$this | setTranslationDomain(string $translationDomain) Sets the default translation domain of violation messages. | |
LoaderInterface[] | getLoaders() | |
ValidatorInterface | getValidator() Builds and returns a new validator object. |
Adds an object initializer to the validator.
ObjectInitializerInterface | $initializer |
$this |
Adds a list of object initializers to the validator.
array | $initializers |
$this |
Adds an XML constraint mapping file to the validator.
string | $path | The path to the mapping file |
$this |
Adds a list of XML constraint mapping files to the validator.
array | $paths | The paths to the mapping files |
$this |
Adds a YAML constraint mapping file to the validator.
string | $path | The path to the mapping file |
$this |
Adds a list of YAML constraint mappings file to the validator.
array | $paths | The paths to the mapping files |
$this |
Enables constraint mapping using the given static method.
string | $methodName | The name of the method |
$this |
Enables constraint mapping using the given static methods.
array | $methodNames | The names of the methods |
$this |
Enables annotation based constraint mapping.
Reader | $annotationReader |
$this |
Disables annotation based constraint mapping.
$this |
Sets the class metadata factory used by the validator.
MetadataFactoryInterface | $metadataFactory |
$this |
Sets the cache for caching class metadata.
CacheInterface | $cache |
$this |
Sets the constraint validator factory used by the validator.
ConstraintValidatorFactoryInterface | $validatorFactory |
$this |
Sets the translator used for translating violation messages.
TranslatorInterface | $translator |
$this |
Sets the default translation domain of violation messages.
The same message can have different translations in different domains. Pass the domain that is used for violation messages by default to this method.
string | $translationDomain | The translation domain of the violation messages |
$this |
LoaderInterface[] |
Builds and returns a new validator object.
ValidatorInterface | The built validator |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Validator/ValidatorBuilder.html