function FieldConfigBase::addPropertyConstraints
Overrides FieldConfigInterface::addPropertyConstraints
File
-
core/
lib/ Drupal/ Core/ Field/ FieldConfigBase.php, line 613
Class
- FieldConfigBase
- Base class for configurable field definitions.
Namespace
Drupal\Core\FieldCode
public function addPropertyConstraints($name, array $constraints) {
foreach ($constraints as $constraint_name => $options) {
$this->propertyConstraints[$name][$constraint_name] = $options;
}
// Reset the field item definition so the next time it is instantiated it
// will receive the new constraints.
$this->itemDefinition = NULL;
return $this;
}