ValidatorBuilder
in package
implements
ValidatorBuilderInterface
The default implementation of {@link ValidatorBuilderInterface}.
Tags
Interfaces, Classes, Traits and Enums
- ValidatorBuilderInterface
- A configurable builder for ValidatorInterface objects.
Table of Contents
- $annotationReader : Reader|null
- $initializers : mixed
- $loaders : mixed
- $mappingCache : CacheItemPoolInterface|null
- $metadataFactory : MetadataFactoryInterface|null
- $methodMappings : mixed
- $translationDomain : string|null
- $translator : TranslatorInterface|null
- $validatorFactory : ConstraintValidatorFactoryInterface|null
- $xmlMappings : mixed
- $yamlMappings : mixed
- addLoader() : $this
- addMethodMapping() : $this
- Enables constraint mapping using the given static method.
- addMethodMappings() : $this
- Enables constraint mapping using the given static methods.
- addObjectInitializer() : $this
- Adds an object initializer to the validator.
- addObjectInitializers() : $this
- Adds a list of object initializers to the validator.
- addXmlMapping() : $this
- Adds an XML constraint mapping file to the validator.
- addXmlMappings() : $this
- Adds a list of XML constraint mapping files to the validator.
- addYamlMapping() : $this
- Adds a YAML constraint mapping file to the validator.
- addYamlMappings() : $this
- Adds a list of YAML constraint mappings file to the validator.
- disableAnnotationMapping() : $this
- Disables annotation based constraint mapping.
- enableAnnotationMapping() : $this
- Enables annotation based constraint mapping.
- getLoaders() : array<string|int, LoaderInterface>
- getValidator() : ValidatorInterface
- Builds and returns a new validator object.
- setConstraintValidatorFactory() : $this
- Sets the constraint validator factory used by the validator.
- setMappingCache() : $this
- Sets the cache for caching class metadata.
- setMetadataCache() : $this
- Sets the cache for caching class metadata.
- setMetadataFactory() : $this
- Sets the class metadata factory used by the validator.
- setTranslationDomain() : $this
- Sets the default translation domain of violation messages.
- setTranslator() : $this
- Sets the translator used for translating violation messages.
- createAnnotationReader() : Reader
Properties
$annotationReader
private
Reader|null
$annotationReader
$initializers
private
mixed
$initializers
= []
$loaders
private
mixed
$loaders
= []
$mappingCache
private
CacheItemPoolInterface|null
$mappingCache
$metadataFactory
private
MetadataFactoryInterface|null
$metadataFactory
$methodMappings
private
mixed
$methodMappings
= []
$translationDomain
private
string|null
$translationDomain
$translator
private
TranslatorInterface|null
$translator
$validatorFactory
private
ConstraintValidatorFactoryInterface|null
$validatorFactory
$xmlMappings
private
mixed
$xmlMappings
= []
$yamlMappings
private
mixed
$yamlMappings
= []
Methods
addLoader()
public
addLoader(LoaderInterface $loader) : $this
Parameters
- $loader : LoaderInterface
Return values
$this —addMethodMapping()
Enables constraint mapping using the given static method.
public
addMethodMapping(mixed $methodName) : $this
Parameters
- $methodName : mixed
-
The name of the method
Return values
$this —addMethodMappings()
Enables constraint mapping using the given static methods.
public
addMethodMappings(array<string|int, mixed> $methodNames) : $this
Parameters
- $methodNames : array<string|int, mixed>
-
The names of the methods
Return values
$this —addObjectInitializer()
Adds an object initializer to the validator.
public
addObjectInitializer(ObjectInitializerInterface $initializer) : $this
Parameters
- $initializer : ObjectInitializerInterface
Return values
$this —addObjectInitializers()
Adds a list of object initializers to the validator.
public
addObjectInitializers(array<string|int, mixed> $initializers) : $this
Parameters
- $initializers : array<string|int, mixed>
Return values
$this —addXmlMapping()
Adds an XML constraint mapping file to the validator.
public
addXmlMapping(mixed $path) : $this
Parameters
- $path : mixed
-
The path to the mapping file
Return values
$this —addXmlMappings()
Adds a list of XML constraint mapping files to the validator.
public
addXmlMappings(array<string|int, mixed> $paths) : $this
Parameters
- $paths : array<string|int, mixed>
-
The paths to the mapping files
Return values
$this —addYamlMapping()
Adds a YAML constraint mapping file to the validator.
public
addYamlMapping(mixed $path) : $this
Parameters
- $path : mixed
-
The path to the mapping file
Return values
$this —addYamlMappings()
Adds a list of YAML constraint mappings file to the validator.
public
addYamlMappings(array<string|int, mixed> $paths) : $this
Parameters
- $paths : array<string|int, mixed>
-
The paths to the mapping files
Return values
$this —disableAnnotationMapping()
Disables annotation based constraint mapping.
public
disableAnnotationMapping() : $this
Return values
$this —enableAnnotationMapping()
Enables annotation based constraint mapping.
public
enableAnnotationMapping([Reader $annotationReader = null ]) : $this
Parameters
- $annotationReader : Reader = null
Return values
$this —getLoaders()
public
getLoaders() : array<string|int, LoaderInterface>
Return values
array<string|int, LoaderInterface> —getValidator()
Builds and returns a new validator object.
public
getValidator() : ValidatorInterface
Return values
ValidatorInterface —The built validator
setConstraintValidatorFactory()
Sets the constraint validator factory used by the validator.
public
setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory) : $this
Parameters
- $validatorFactory : ConstraintValidatorFactoryInterface
Return values
$this —setMappingCache()
Sets the cache for caching class metadata.
public
setMappingCache(CacheItemPoolInterface $cache) : $this
Parameters
- $cache : CacheItemPoolInterface
Return values
$this —setMetadataCache()
Sets the cache for caching class metadata.
public
setMetadataCache(CacheInterface $cache) : $this
Parameters
- $cache : CacheInterface
Tags
Return values
$this —setMetadataFactory()
Sets the class metadata factory used by the validator.
public
setMetadataFactory(MetadataFactoryInterface $metadataFactory) : $this
Parameters
- $metadataFactory : MetadataFactoryInterface
Return values
$this —setTranslationDomain()
Sets the default translation domain of violation messages.
public
setTranslationDomain(mixed $translationDomain) : $this
Parameters
- $translationDomain : mixed
-
The translation domain of the violation messages
Return values
$this —setTranslator()
Sets the translator used for translating violation messages.
public
setTranslator(TranslatorInterface $translator) : $this
Parameters
- $translator : TranslatorInterface
Tags
Return values
$this —createAnnotationReader()
private
createAnnotationReader() : Reader