Class

Symfony\Component\Validator\GraphWalker

class GraphWalker

Responsible for walking over and initializing validation on different types of items.

Methods

__construct(ValidationVisitor $visitor, MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, null|string $translationDomain = null, array $validatedObjects = array())

Creates a new graph walker.

ConstraintViolationList getViolations()

walkObject(ClassMetadata $metadata, object $object, string $group, string $propertyPath)

Initialize validation on the given object using the given metadata instance and validation group.

walkProperty(ClassMetadata $metadata, $property $property, $object $object, $group $group, $propertyPath $propertyPath, null $propagatedGroup = null)

Validates a property of a class.

walkPropertyValue(ClassMetadata $metadata, $property $property, $value $value, $group $group, $propertyPath $propertyPath)

Validates a property of a class against a potential value.

walkReference($value $value, $group $group, $propertyPath $propertyPath, $traverse $traverse, bool $deep = false)

Validates an object or an array.

walkConstraint(Constraint $constraint, $value $value, $group $group, $propertyPath $propertyPath, null $currentClass = null, null $currentProperty = null)

Validates a value against a constraint.

Details

at line 69
public __construct(ValidationVisitor $visitor, MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, null|string $translationDomain = null, array $validatedObjects = array())

Creates a new graph walker.

Parameters

ValidationVisitor $visitor
MetadataFactoryInterface $metadataFactory
TranslatorInterface $translator
null|string $translationDomain
array $validatedObjects

at line 85
public ConstraintViolationList getViolations()

at line 103
public walkObject(ClassMetadata $metadata, object $object, string $group, string $propertyPath)

Initialize validation on the given object using the given metadata instance and validation group.

Parameters

ClassMetadata $metadata
object $object The object to validate
string $group The validator group to use for validation
string $propertyPath

at line 140
public walkProperty(ClassMetadata $metadata, $property $property, $object $object, $group $group, $propertyPath $propertyPath, null $propagatedGroup = null)

Validates a property of a class.

Parameters

ClassMetadata $metadata
$property $property
$object $object
$group $group
$propertyPath $propertyPath
null $propagatedGroup

Exceptions

UnexpectedTypeException

at line 164
public walkPropertyValue(ClassMetadata $metadata, $property $property, $value $value, $group $group, $propertyPath $propertyPath)

Validates a property of a class against a potential value.

Parameters

ClassMetadata $metadata
$property $property
$value $value
$group $group
$propertyPath $propertyPath

at line 189
public walkReference($value $value, $group $group, $propertyPath $propertyPath, $traverse $traverse, bool $deep = false)

Validates an object or an array.

Parameters

$value $value
$group $group
$propertyPath $propertyPath
$traverse $traverse
bool $deep

at line 208
public walkConstraint(Constraint $constraint, $value $value, $group $group, $propertyPath $propertyPath, null $currentClass = null, null $currentProperty = null)

Validates a value against a constraint.

Parameters

Constraint $constraint
$value $value
$group $group
$propertyPath $propertyPath
null $currentClass
null $currentProperty