function EntityDataDefinition::createFromDataType
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::createFromDataType()
- 8.9.x core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::createFromDataType()
- 10 core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::createFromDataType()
Overrides DataDefinition::createFromDataType
File
-
core/
lib/ Drupal/ Core/ Entity/ TypedData/ EntityDataDefinition.php, line 58
Class
- EntityDataDefinition
- A typed data definition class for describing entities.
Namespace
Drupal\Core\Entity\TypedDataCode
public static function createFromDataType($data_type) {
$parts = explode(':', $data_type);
if ($parts[0] != 'entity') {
throw new \InvalidArgumentException('Data type must be in the form of "entity:ENTITY_TYPE:BUNDLE."');
}
return static::create($parts[1] ?? NULL, $parts[2] ?? NULL);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.