function DataDefinition::addConstraint
Same name in other branches
- 9 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::addConstraint()
- 10 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::addConstraint()
- 11.x core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::addConstraint()
Overrides DataDefinitionInterface::addConstraint
2 calls to DataDefinition::addConstraint()
- EntityDataDefinition::setBundles in core/
lib/ Drupal/ Core/ Entity/ TypedData/ EntityDataDefinition.php - Sets the array of possible entity bundles.
- EntityDataDefinition::setEntityTypeId in core/
lib/ Drupal/ Core/ Entity/ TypedData/ EntityDataDefinition.php - Sets the entity type ID.
File
-
core/
lib/ Drupal/ Core/ TypedData/ DataDefinition.php, line 293
Class
- DataDefinition
- A typed data definition class for defining data based on defined data types.
Namespace
Drupal\Core\TypedDataCode
public function addConstraint($constraint_name, $options = NULL) {
$this->definition['constraints'][$constraint_name] = $options;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.