Symfony2 API
Class

Symfony\Component\Validator\ValidatorContext

class ValidatorContext implements ValidatorContextInterface

Default implementation of ValidatorContextInterface

Methods

setClassMetadataFactory(ClassMetadataFactoryInterface $classMetadataFactory)

Sets the class metadata factory used in the new validator

setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $constraintValidatorFactory)

Sets the constraint validator factory used in the new validator

ValidatorInterface getValidator()

Creates a new validator with the settings stored in this context

ClassMetadataFactoryInterface getClassMetadataFactory()

Returns the class metadata factory used in the new validator

ConstraintValidatorFactoryInterface getConstraintValidatorFactory()

Returns the constraint validator factory used in the new validator

Details

at line 50
public setClassMetadataFactory(ClassMetadataFactoryInterface $classMetadataFactory)

Sets the class metadata factory used in the new validator

Parameters

ClassMetadataFactoryInterface $classMetadataFactory The factory instance

at line 71
public setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $constraintValidatorFactory)

Sets the constraint validator factory used in the new validator

Parameters

ConstraintValidatorFactoryInterface $constraintValidatorFactory The factory instance

at line 86
public ValidatorInterface getValidator()

Creates a new validator with the settings stored in this context

Return Value

ValidatorInterface The new validator

at line 104
public ClassMetadataFactoryInterface getClassMetadataFactory()

Returns the class metadata factory used in the new validator

Return Value

ClassMetadataFactoryInterface The factory instance

at line 118
public ConstraintValidatorFactoryInterface getConstraintValidatorFactory()

Returns the constraint validator factory used in the new validator

Return Value

ConstraintValidatorFactoryInterface The factory instance