You are here

public function RecursiveValidator::validateProperty in Zircon Profile 8

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

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

vendor/symfony/validator/Validator/RecursiveValidator.php, line 141

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();
}