ValidatorBuilder
in package
Tags
Table of Contents
Properties
- $annotationReader : mixed
- $enableAnnotationMapping : bool
- $initializers : array<string|int, mixed>
- $loaders : array<string|int, mixed>
- $mappingCache : mixed
- $metadataFactory : mixed
- $methodMappings : array<string|int, mixed>
- $translationDomain : string|null
- $translator : mixed
- $validatorFactory : mixed
- $xmlMappings : array<string|int, mixed>
- $yamlMappings : array<string|int, mixed>
Methods
- addDefaultDoctrineAnnotationReader() : $this
- 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.
- setDoctrineAnnotationReader() : $this
- setMappingCache() : $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
mixed
$annotationReader
= null
$enableAnnotationMapping
private
bool
$enableAnnotationMapping
= false
$initializers
private
array<string|int, mixed>
$initializers
= []
$loaders
private
array<string|int, mixed>
$loaders
= []
$mappingCache
private
mixed
$mappingCache
= null
$metadataFactory
private
mixed
$metadataFactory
= null
$methodMappings
private
array<string|int, mixed>
$methodMappings
= []
$translationDomain
private
string|null
$translationDomain
= null
$translator
private
mixed
$translator
= null
$validatorFactory
private
mixed
$validatorFactory
$xmlMappings
private
array<string|int, mixed>
$xmlMappings
= []
$yamlMappings
private
array<string|int, mixed>
$yamlMappings
= []
Methods
addDefaultDoctrineAnnotationReader()
public
addDefaultDoctrineAnnotationReader() : $this
Return values
$thisaddLoader()
public
addLoader(LoaderInterface $loader) : $this
Parameters
- $loader : LoaderInterface
Return values
$thisaddMethodMapping()
Enables constraint mapping using the given static method.
public
addMethodMapping(string $methodName) : $this
Parameters
- $methodName : string
Return values
$thisaddMethodMappings()
Enables constraint mapping using the given static methods.
public
addMethodMappings(array<string|int, string> $methodNames) : $this
Parameters
- $methodNames : array<string|int, string>
-
The names of the methods
Return values
$thisaddObjectInitializer()
Adds an object initializer to the validator.
public
addObjectInitializer(ObjectInitializerInterface $initializer) : $this
Parameters
- $initializer : ObjectInitializerInterface
Return values
$thisaddObjectInitializers()
Adds a list of object initializers to the validator.
public
addObjectInitializers(array<string|int, ObjectInitializerInterface> $initializers) : $this
Parameters
- $initializers : array<string|int, ObjectInitializerInterface>
Return values
$thisaddXmlMapping()
Adds an XML constraint mapping file to the validator.
public
addXmlMapping(string $path) : $this
Parameters
- $path : string
Return values
$thisaddXmlMappings()
Adds a list of XML constraint mapping files to the validator.
public
addXmlMappings(array<string|int, string> $paths) : $this
Parameters
- $paths : array<string|int, string>
-
The paths to the mapping files
Return values
$thisaddYamlMapping()
Adds a YAML constraint mapping file to the validator.
public
addYamlMapping(string $path) : $this
Parameters
- $path : string
-
The path to the mapping file
Return values
$thisaddYamlMappings()
Adds a list of YAML constraint mappings file to the validator.
public
addYamlMappings(array<string|int, string> $paths) : $this
Parameters
- $paths : array<string|int, string>
-
The paths to the mapping files
Return values
$thisdisableAnnotationMapping()
Disables annotation based constraint mapping.
public
disableAnnotationMapping() : $this
Return values
$thisenableAnnotationMapping()
Enables annotation based constraint mapping.
public
enableAnnotationMapping() : $this
Return values
$thisgetLoaders()
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
ValidatorInterfacesetConstraintValidatorFactory()
Sets the constraint validator factory used by the validator.
public
setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory) : $this
Parameters
- $validatorFactory : ConstraintValidatorFactoryInterface
Return values
$thissetDoctrineAnnotationReader()
public
setDoctrineAnnotationReader(Reader|null $reader) : $this
Parameters
- $reader : Reader|null
Return values
$thissetMappingCache()
Sets the cache for caching class metadata.
public
setMappingCache(CacheItemPoolInterface $cache) : $this
Parameters
- $cache : CacheItemPoolInterface
Return values
$thissetMetadataFactory()
Sets the class metadata factory used by the validator.
public
setMetadataFactory(MetadataFactoryInterface $metadataFactory) : $this
Parameters
- $metadataFactory : MetadataFactoryInterface
Return values
$thissetTranslationDomain()
Sets the default translation domain of violation messages.
public
setTranslationDomain(string|null $translationDomain) : $this
The same message can have different translations in different domains. Pass the domain that is used for violation messages by default to this method.
Parameters
- $translationDomain : string|null
Return values
$thissetTranslator()
Sets the translator used for translating violation messages.
public
setTranslator(TranslatorInterface $translator) : $this
Parameters
- $translator : TranslatorInterface
Return values
$thiscreateAnnotationReader()
private
createAnnotationReader() : Reader