ValidationVisitor deprecated
class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionContextInterface
deprecated
Default implementation of {@link ValidationVisitorInterface} and {@link GlobalExecutionContextInterface}.
Methods
Creates a new validation visitor.
Validates a value against the constraints defined in some metadata.
Validates a value.
Returns the violations generated by the validator so far.
Returns the value at which validation was started in the object graph.
Returns the visitor instance used to validate the object graph nodes.
Returns the factory for constraint validators.
Returns the factory for validation metadata objects.
Details
at line line 82
__construct(mixed $root, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, TranslatorInterface $translator, string|null $translationDomain = null, array $objectInitializers = array())
Creates a new validation visitor.
at line line 102
visit(MetadataInterface $metadata, mixed $value, string $group, string $propertyPath)
Validates a value against the constraints defined in some metadata.
This method implements the Visitor design pattern. See also {@link ValidationVisitorInterface}.
at line line 120
validate(mixed $value, string $group, string $propertyPath, bool $traverse = false, bool $deep = false)
Validates a value.
If the value is an array or a traversable object, you can set the parameter $traverse to true in order to run through the collection and validate each element. If these elements can be collections again and you want to traverse them recursively, set the parameter $deep to true as well.
If you set $traversable to true, the visitor will nevertheless try to find metadata for the collection and validate its constraints. If no such metadata is found, the visitor ignores that and only iterates the collection.
If you don't set $traversable to true and the visitor does not find metadata for the given value, it will fail with an exception.
at line line 176
ConstraintViolationListInterface
getViolations()
Returns the violations generated by the validator so far.
at line line 184
mixed
getRoot()
Returns the value at which validation was started in the object graph.
at line line 192
ValidationVisitorInterface
getVisitor()
Returns the visitor instance used to validate the object graph nodes.
at line line 200
ConstraintValidatorFactoryInterface
getValidatorFactory()
Returns the factory for constraint validators.
at line line 208
MetadataFactoryInterface
getMetadataFactory()
Returns the factory for validation metadata objects.