function TypedDataManager::createDataDefinition
Same name in other branches
- 9 core/lib/Drupal/Core/TypedData/TypedDataManager.php \Drupal\Core\TypedData\TypedDataManager::createDataDefinition()
- 10 core/lib/Drupal/Core/TypedData/TypedDataManager.php \Drupal\Core\TypedData\TypedDataManager::createDataDefinition()
- 11.x core/lib/Drupal/Core/TypedData/TypedDataManager.php \Drupal\Core\TypedData\TypedDataManager::createDataDefinition()
Overrides TypedDataManagerInterface::createDataDefinition
1 call to TypedDataManager::createDataDefinition()
- TypedConfigManager::buildDataDefinition in core/
lib/ Drupal/ Core/ Config/ TypedConfigManager.php - Creates a new data definition object from a type definition array and actual configuration data. Since type definitions may contain variables to be replaced, we need the configuration value to create it.
File
-
core/
lib/ Drupal/ Core/ TypedData/ TypedDataManager.php, line 114
Class
- TypedDataManager
- Manages data type plugins.
Namespace
Drupal\Core\TypedDataCode
public function createDataDefinition($data_type) {
$type_definition = $this->getDefinition($data_type);
if (!isset($type_definition)) {
throw new \InvalidArgumentException("Invalid data type '{$data_type}' has been given");
}
$class = $type_definition['definition_class'];
$data_definition = $class::createFromDataType($data_type);
if (method_exists($data_definition, 'setTypedDataManager')) {
$data_definition->setTypedDataManager($this);
}
return $data_definition;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.