mediatekformation

ValidatorBuilderInterface

A configurable builder for ValidatorInterface objects.

Tags
author

Bernhard Schussek bschussek@gmail.com

deprecated

since Symfony 4.2, use the ValidatorBuilder class instead

Table of Contents

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.
getValidator()  : ValidatorInterface
Builds and returns a new validator object.
setConstraintValidatorFactory()  : $this
Sets the constraint validator factory used by the validator.
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.

Methods

addMethodMapping()

Enables constraint mapping using the given static method.

public addMethodMapping(string $methodName) : $this
Parameters
$methodName : string

The name of the method

Return values
$this

addMethodMappings()

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
$this

addXmlMapping()

Adds an XML constraint mapping file to the validator.

public addXmlMapping(string $path) : $this
Parameters
$path : string

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, string> $paths) : $this
Parameters
$paths : array<string|int, string>

The paths to the mapping files

Return values
$this

addYamlMapping()

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
$this

addYamlMappings()

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
$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

setTranslationDomain()

Sets the default translation domain of violation messages.

public setTranslationDomain(string $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

The translation domain of the violation messages

Return values
$this

Search results