interface ValidationVisitorInterface

Validates values against constraints defined in {@link MetadataInterface} instances.

This interface is an implementation of the Visitor design pattern. A value is validated by first passing it to the {@link validate} method. That method will determine the matching {@link MetadataInterface} for validating the value. It then calls the {@link MetadataInterface::accept} method of that metadata. <tt>accept()</tt> does two things:

<ol> <li>It calls {@link visit} to validate the value against the constraints of the metadata.</li> <li>It calls <tt>accept()</tt> on all nested metadata instances with the corresponding values extracted from the current value. For example, if the current metadata represents a class and the current value is an object of that class, the metadata contains nested instances for each property of that class. It forwards the call to these nested metadata with the values of the corresponding properties in the original object.</li> </ol>

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of ValidationVisitorInterface

All classes that implement ValidationVisitorInterface

4 files declare their use of ValidationVisitorInterface

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/ValidationVisitorInterface.php, line 37

Namespace

Symfony\Component\Validator
View source

Members

Namesort descending Modifiers Type Description Overrides
ValidationVisitorInterface::validate public function Validates a value. 1
ValidationVisitorInterface::visit public function Validates a value against the constraints defined in some metadata. 1