You are here

public function TypedData::validate in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::validate()
  2. 9 core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::validate()

Validates the currently set data value.

Return value

\Symfony\Component\Validator\ConstraintViolationListInterface A list of constraint violations. If the list is empty, validation succeeded.

Overrides TypedDataInterface::validate

1 call to TypedData::validate()
FieldItemList::defaultValuesFormValidate in core/lib/Drupal/Core/Field/FieldItemList.php
Validates the submitted default value.

File

core/lib/Drupal/Core/TypedData/TypedData.php, line 131

Class

TypedData
The abstract base class for typed data.

Namespace

Drupal\Core\TypedData

Code

public function validate() {
  return $this
    ->getTypedDataManager()
    ->getValidator()
    ->validate($this);
}