PHP Class Symfony\Component\Validator\Validator\RecursiveContextualValidator

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

Méthodes publiques

Méthode 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 )

Méthodes protégées

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

Private Methods

Méthode 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 méthode

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 méthode

public atPath ( $path )

getViolations() public méthode

public getViolations ( )

normalizeGroups() protected méthode

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

validate() public méthode

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

validateProperty() public méthode

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

validatePropertyValue() public méthode

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