Documentation

ContainerConstraintValidatorFactory
in package
implements ConstraintValidatorFactoryInterface

Uses a service container to create constraint validators.

Tags
author

Kris Wallsmith kris@symfony.com

Table of Contents

Interfaces

ConstraintValidatorFactoryInterface
Specifies an object able to return the correct ConstraintValidatorInterface instance given a Constraint object.

Properties

$container  : mixed
$validators  : array<string|int, mixed>

Methods

__construct()  : mixed
getInstance()  : ConstraintValidatorInterface
Given a Constraint, this returns the ConstraintValidatorInterface object that should be used to verify its validity.

Properties

Methods

getInstance()

Given a Constraint, this returns the ConstraintValidatorInterface object that should be used to verify its validity.

public getInstance(Constraint $constraint) : ConstraintValidatorInterface
Parameters
$constraint : Constraint
Tags
throws
ValidatorException

When the validator class does not exist

throws
UnexpectedTypeException

When the validator is not an instance of ConstraintValidatorInterface

Return values
ConstraintValidatorInterface

        
On this page

Search results