Implements \Drupal\Core\TypedData\TypedDataInterface::getConstraints().
Overrides TypedData::getConstraints
public function getConstraints() {
$constraints = parent::getConstraints();
// If property constraints are present add in a ComplexData constraint for
// applying them.
if (!empty($this->definition['property_constraints'])) {
$constraints[] = \Drupal::typedData()
->getValidationConstraintManager()
->create('ComplexData', $this->definition['property_constraints']);
}
return $constraints;
}