ValidatorBuilder
class ValidatorBuilder implements ValidatorBuilderInterface
The default implementation of {@link ValidatorBuilderInterface}.
Methods
Adds an object initializer to the validator.
Adds a list of object initializers to the validator.
Adds an XML constraint mapping file to the validator.
Adds a list of XML constraint mapping files to the validator.
Adds a YAML constraint mapping file to the validator.
Adds a list of YAML constraint mappings file to the validator.
Enables constraint mapping using the given static method.
Enables constraint mapping using the given static methods.
Enables annotation based constraint mapping.
Disables annotation based constraint mapping.
Sets the class metadata factory used by the validator.
Sets the constraint validator factory used by the validator.
Sets the translator used for translating violation messages.
Sets the default translation domain of violation messages.
Builds and returns a new validator object.
Details
at line line 100
ValidatorBuilderInterface
addObjectInitializer(ObjectInitializerInterface $initializer)
Adds an object initializer to the validator.
at line line 110
ValidatorBuilderInterface
addObjectInitializers(array $initializers)
Adds a list of object initializers to the validator.
at line line 120
ValidatorBuilderInterface
addXmlMapping(string $path)
Adds an XML constraint mapping file to the validator.
at line line 134
ValidatorBuilderInterface
addXmlMappings(array $paths)
Adds a list of XML constraint mapping files to the validator.
at line line 148
ValidatorBuilderInterface
addYamlMapping(string $path)
Adds a YAML constraint mapping file to the validator.
at line line 162
ValidatorBuilderInterface
addYamlMappings(array $paths)
Adds a list of YAML constraint mappings file to the validator.
at line line 176
ValidatorBuilderInterface
addMethodMapping(string $methodName)
Enables constraint mapping using the given static method.
at line line 190
ValidatorBuilderInterface
addMethodMappings(array $methodNames)
Enables constraint mapping using the given static methods.
at line line 204
ValidatorBuilderInterface
enableAnnotationMapping(Reader $annotationReader = null)
Enables annotation based constraint mapping.
at line line 226
ValidatorBuilderInterface
disableAnnotationMapping()
Disables annotation based constraint mapping.
at line line 236
ValidatorBuilderInterface
setMetadataFactory(MetadataFactoryInterface $metadataFactory)
Sets the class metadata factory used by the validator.
at line line 250
ValidatorBuilderInterface
setMetadataCache(CacheInterface $cache)
Sets the cache for caching class metadata.
at line line 264
ValidatorBuilderInterface
setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory)
Sets the constraint validator factory used by the validator.
at line line 278
ValidatorBuilderInterface
setTranslator(TranslatorInterface $translator)
Sets the translator used for translating violation messages.
at line line 288
ValidatorBuilderInterface
setTranslationDomain(string $translationDomain)
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.
at line line 298
ValidatorInterface
getValidator()
Builds and returns a new validator object.