public BaseFieldDefinition::addPropertyConstraints($name, array $constraints)
Adds constraints for a given field item property.
Adds a constraint to a property of a base field item. e.g.
// Limit the field item's value property to the range 0 through 10.
// e.g. $node->size->value.
$field->addPropertyConstraints('value', [
'Range' => [
'min' => 0,
'max' => 10,
]
]);
If you want to add a validation constraint that applies to the \Drupal\Core\Field\FieldItemList, u