PHP Class Symfony\Component\Validator\Validator\RecursiveContextualValidator

Since: 2.5
Author: Bernhard Schussek ([email protected])
Inheritance: implements Symfony\Component\Validator\Validator\ContextualValidatorInterface
Exibir arquivo Open project: symfony/symfony

Public Methods

Method Description
__construct ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface $metadataFactory, Symfony\Component\Validator\ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = [] ) Creates a validator for the given context.
atPath ( $path )
getViolations ( )
validate ( $value, $constraints = null, $groups = null )
validateProperty ( $object, $propertyName, $groups = null )
validatePropertyValue ( $objectOrClass, $propertyName, $value, $groups = null )

Protected Methods

Method Description
normalizeGroups ( mixed $groups ) : array Normalizes the given group or list of groups to an array.

Private Methods

Method Description
stepThroughGroupSequence ( mixed $value, object | null $object, string $cacheKey, Symfony\Component\Validator\Mapping\MetadataInterface $metadata = null, string $propertyPath, integer $traversalStrategy, GroupSequence $groupSequence, string | null $cascadedGroup, Symfony\Component\Validator\Context\ExecutionContextInterface $context ) Sequentially validates a node's value in each group of a group sequence.
validateClassNode ( object $object, string $cacheKey, Symfony\Component\Validator\Mapping\ClassMetadataInterface $metadata = null, string $propertyPath, array $groups, string[] | null $cascadedGroups, integer $traversalStrategy, Symfony\Component\Validator\Context\ExecutionContextInterface $context ) Validates a class node.
validateEachObjectIn ( array | Traversable $collection, string $propertyPath, array $groups, Symfony\Component\Validator\Context\ExecutionContextInterface $context ) Validates each object in a collection against the constraints defined for their classes.
validateGenericNode ( mixed $value, object | null $object, string $cacheKey, Symfony\Component\Validator\Mapping\MetadataInterface $metadata = null, string $propertyPath, array $groups, string[] | null $cascadedGroups, integer $traversalStrategy, Symfony\Component\Validator\Context\ExecutionContextInterface $context ) Validates a node that is not a class node.
validateInGroup ( mixed $value, string $cacheKey, Symfony\Component\Validator\Mapping\MetadataInterface $metadata, string $group, Symfony\Component\Validator\Context\ExecutionContextInterface $context ) Validates a node's value against all constraints in the given group.
validateObject ( object $object, string $propertyPath, array $groups, integer $traversalStrategy, Symfony\Component\Validator\Context\ExecutionContextInterface $context ) Validates an object against the constraints defined for its class.

Method Details

__construct() public method

Creates a validator for the given context.
public __construct ( Symfony\Component\Validator\Context\ExecutionContextInterface $context, Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface $metadataFactory, Symfony\Component\Validator\ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = [] )
$context Symfony\Component\Validator\Context\ExecutionContextInterface The execution context
$metadataFactory Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface The factory for fetching the metadata of validated objects
$validatorFactory Symfony\Component\Validator\ConstraintValidatorFactoryInterface The factory for creating constraint validators
$objectInitializers array The object initializers

atPath() public method

public atPath ( $path )

getViolations() public method

public getViolations ( )

normalizeGroups() protected method

Normalizes the given group or list of groups to an array.
protected normalizeGroups ( mixed $groups ) : array
$groups mixed The groups to normalize
return array A group array

validate() public method

public validate ( $value, $constraints = null, $groups = null )

validateProperty() public method

public validateProperty ( $object, $propertyName, $groups = null )

validatePropertyValue() public method

public validatePropertyValue ( $objectOrClass, $propertyName, $value, $groups = null )