ValidatorBuilder
class ValidatorBuilder implements ValidatorBuilderInterface
The default implementation of {@link ValidatorBuilderInterface}.
Traits
Methods
{@inheritdoc}
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.
No description
Builds and returns a new validator object.
Details
$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
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
setMetadataFactory(MetadataFactoryInterface $metadataFactory)
Sets the class metadata factory used by the validator.
$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.