You are here

public function ContextualValidatorInterface::validate in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Validator/ContextualValidatorInterface.php \Symfony\Component\Validator\Validator\ContextualValidatorInterface::validate()
  2. 8 core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php \Drupal\Core\TypedData\Validation\ContextualValidatorInterface::validate()
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php \Drupal\Core\TypedData\Validation\ContextualValidatorInterface::validate()

Validates a value against a constraint or a list of constraints.

If no constraint is passed, the constraint \Symfony\Component\Validator\Constraints\Valid is assumed.

Parameters

mixed $value: The value to validate

\Symfony\Component\Validator\Constraint|\Symfony\Component\Validator\Constraint[] $constraints: The constraint(s) to validate against.

array|null $groups: The validation groups to validate, defaults to "Default".

bool $is_root_call: (optional) Whether its the most upper call in the typed data tree.

Return value

$this

Overrides ContextualValidatorInterface::validate

See also

\Symfony\Component\Validator\Constraints\Valid

1 method overrides ContextualValidatorInterface::validate()
RecursiveContextualValidator::validate in core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php
Validates a value against a constraint or a list of constraints.

File

core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php, line 36
Contains \Drupal\Core\TypedData\Validation\ContextualValidatorInterface.

Class

ContextualValidatorInterface
Extends the contextual validator validate method by a new parameter.

Namespace

Drupal\Core\TypedData\Validation

Code

public function validate($value, $constraints = NULL, $groups = NULL, $is_root_call = TRUE);