function TypedData::getConstraints
Same name in other branches
- 9 core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::getConstraints()
- 10 core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::getConstraints()
- 11.x core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::getConstraints()
Overrides TypedDataInterface::getConstraints
9 calls to TypedData::getConstraints()
- EmailItem::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EmailItem.php - Gets a list of validation constraints.
- EntityReferenceItem::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EntityReferenceItem.php - Gets a list of validation constraints.
- FieldItemList::getConstraints in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Gets a list of validation constraints.
- NumericItemBase::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ NumericItemBase.php - Gets a list of validation constraints.
- StringItem::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ StringItem.php - Gets a list of validation constraints.
9 methods override TypedData::getConstraints()
- EmailItem::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EmailItem.php - Gets a list of validation constraints.
- EntityReferenceItem::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EntityReferenceItem.php - Gets a list of validation constraints.
- FieldItemList::getConstraints in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Gets a list of validation constraints.
- NumericItemBase::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ NumericItemBase.php - Gets a list of validation constraints.
- StringItem::getConstraints in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ StringItem.php - Gets a list of validation constraints.
File
-
core/
lib/ Drupal/ Core/ TypedData/ TypedData.php, line 119
Class
- TypedData
- The abstract base class for typed data.
Namespace
Drupal\Core\TypedDataCode
public function getConstraints() {
$constraint_manager = $this->getTypedDataManager()
->getValidationConstraintManager();
$constraints = [];
foreach ($this->definition
->getConstraints() as $name => $options) {
$constraints[] = $constraint_manager->create($name, $options);
}
return $constraints;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.