You are here

public function RecursiveValidator::validateProperty in Plug 7

Validates a property of an object against the constraints specified for this property.

Parameters

object $object The object:

string $propertyName The name of the validated property:

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

Overrides ValidatorInterface::validateProperty

File

lib/Symfony/validator/Symfony/Component/Validator/Validator/RecursiveValidator.php, line 123

Class

RecursiveValidator
Recursive implementation of {@link ValidatorInterface}.

Namespace

Symfony\Component\Validator\Validator

Code

public function validateProperty($object, $propertyName, $groups = null) {
  return $this
    ->startContext($object)
    ->validateProperty($object, $propertyName, $groups)
    ->getViolations();
}