class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
Uses a service container to create constraint validators.
A constraint validator should be tagged as "validator.constraint_validator" in the service container and include an "alias" attribute:
<service id="some_doctrine_validator">
<argument type="service" id="doctrine.orm.some_entity_manager" />
<tag name="validator.constraint_validator" alias="some_alias" />
</service>
A constraint may then return this alias in its validatedBy() method:
public function validatedBy()
{
return 'some_alias';
}
__construct(ContainerInterface $container, array $validators = array()) Constructor. | ||
ConstraintValidatorInterface | getInstance(Constraint $constraint) Returns the validator for the supplied constraint. |
Constructor.
Returns the validator for the supplied constraint.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.html