You are here

public function ValidatorInterface::validate in Plug 7

Same name in this branch
  1. 7 lib/Symfony/validator/Symfony/Component/Validator/ValidatorInterface.php \Symfony\Component\Validator\ValidatorInterface::validate()
  2. 7 lib/Symfony/validator/Symfony/Component/Validator/Validator/ValidatorInterface.php \Symfony\Component\Validator\Validator\ValidatorInterface::validate()

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

If no constraint is passed, the constraint {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.

Parameters

mixed $value The value to validate:

Constraint|Constraint[] $constraints The constraint(s) to validate: against

array|null $groups The validation groups to: validate. If none is given, "Default" is assumed

Return value

ConstraintViolationListInterface A list of constraint violations. If the list is empty, validation succeeded

1 method overrides ValidatorInterface::validate()
RecursiveValidator::validate in lib/Symfony/validator/Symfony/Component/Validator/Validator/RecursiveValidator.php
Validates a value against a constraint or a list of constraints.

File

lib/Symfony/validator/Symfony/Component/Validator/Validator/ValidatorInterface.php, line 44

Class

ValidatorInterface
Validates PHP values against constraints.

Namespace

Symfony\Component\Validator\Validator

Code

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