RecursiveValidator
in package
implements
ValidatorInterface
Recursive implementation of {@link ValidatorInterface}.
Tags
Interfaces, Classes, Traits and Enums
- ValidatorInterface
- Validates PHP values against constraints.
Table of Contents
- $contextFactory : mixed
- $metadataFactory : mixed
- $objectInitializers : mixed
- $validatorFactory : mixed
- __construct() : mixed
- Creates a new validator.
- getMetadataFor() : mixed
- {@inheritdoc}
- hasMetadataFor() : mixed
- {@inheritdoc}
- inContext() : ContextualValidatorInterface
- Returns a validator in the given execution context.
- startContext() : ContextualValidatorInterface
- Starts a new validation context and returns a validator for that context.
- validate() : ConstraintViolationListInterface
- Validates a value against a constraint or a list of constraints.
- validateProperty() : ConstraintViolationListInterface
- Validates a property of an object against the constraints specified for this property.
- validatePropertyValue() : ConstraintViolationListInterface
- Validates a value against the constraints specified for an object's property.
Properties
$contextFactory
protected
mixed
$contextFactory
$metadataFactory
protected
mixed
$metadataFactory
$objectInitializers
protected
mixed
$objectInitializers
$validatorFactory
protected
mixed
$validatorFactory
Methods
__construct()
Creates a new validator.
public
__construct(ExecutionContextFactoryInterface $contextFactory, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory[, array<string|int, ObjectInitializerInterface> $objectInitializers = [] ]) : mixed
Parameters
- $contextFactory : ExecutionContextFactoryInterface
- $metadataFactory : MetadataFactoryInterface
- $validatorFactory : ConstraintValidatorFactoryInterface
- $objectInitializers : array<string|int, ObjectInitializerInterface> = []
-
The object initializers
Return values
mixed —getMetadataFor()
{@inheritdoc}
public
getMetadataFor(mixed $object) : mixed
Parameters
- $object : mixed
Return values
mixed —hasMetadataFor()
{@inheritdoc}
public
hasMetadataFor(mixed $object) : mixed
Parameters
- $object : mixed
Return values
mixed —inContext()
Returns a validator in the given execution context.
public
inContext(ExecutionContextInterface $context) : ContextualValidatorInterface
Parameters
- $context : ExecutionContextInterface
Return values
ContextualValidatorInterface —The validator for that context
startContext()
Starts a new validation context and returns a validator for that context.
public
startContext([mixed $root = null ]) : ContextualValidatorInterface
Parameters
- $root : mixed = null
Return values
ContextualValidatorInterface —The validator for the new context
validate()
Validates a value against a constraint or a list of constraints.
public
validate(mixed $value[, mixed $constraints = null ][, mixed $groups = null ]) : ConstraintViolationListInterface
Parameters
- $value : mixed
-
The value to validate
- $constraints : mixed = null
-
The constraint(s) to validate against
- $groups : mixed = null
-
The validation groups to validate. If none is given, "Default" is assumed
Return values
ConstraintViolationListInterface —A list of constraint violations If the list is empty, validation succeeded
validateProperty()
Validates a property of an object against the constraints specified for this property.
public
validateProperty(mixed $object, mixed $propertyName[, mixed $groups = null ]) : ConstraintViolationListInterface
Parameters
- $object : mixed
-
The object
- $propertyName : mixed
-
The name of the validated property
- $groups : mixed = null
-
The validation groups to validate. If none is given, "Default" is assumed
Return values
ConstraintViolationListInterface —A list of constraint violations If the list is empty, validation succeeded
validatePropertyValue()
Validates a value against the constraints specified for an object's property.
public
validatePropertyValue(mixed $objectOrClass, mixed $propertyName, mixed $value[, mixed $groups = null ]) : ConstraintViolationListInterface
Parameters
- $objectOrClass : mixed
-
The object or its class name
- $propertyName : mixed
-
The name of the property
- $value : mixed
-
The value to validate against the property's constraints
- $groups : mixed = null
-
The validation groups to validate. If none is given, "Default" is assumed
Return values
ConstraintViolationListInterface —A list of constraint violations If the list is empty, validation succeeded