RecursiveValidator::validateProperty

public RecursiveValidator::validateProperty($object, $propertyName, $groups = NULL)

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

core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php, line 97

Class

RecursiveValidator
Defines a recursive validator for Typed Data.

Namespace

Drupal\Core\TypedData\Validation

Code

public function validateProperty($object, $propertyName, $groups = NULL) {
  return $this->startContext($object)
    ->validateProperty($object, $propertyName, $groups)
    ->getViolations();
}
doc_Drupal
2016-10-29 09:36:50
Comments
Leave a Comment

Please login to continue.