function TypedDataManager::create
Same name in other branches
- 9 core/lib/Drupal/Core/TypedData/TypedDataManager.php \Drupal\Core\TypedData\TypedDataManager::create()
- 8.9.x core/lib/Drupal/Core/TypedData/TypedDataManager.php \Drupal\Core\TypedData\TypedDataManager::create()
- 11.x core/lib/Drupal/Core/TypedData/TypedDataManager.php \Drupal\Core\TypedData\TypedDataManager::create()
2 calls to TypedDataManager::create()
- TypedConfigManager::createFromNameAndData in core/
lib/ Drupal/ Core/ Config/ TypedConfigManager.php - TypedDataManager::getPropertyInstance in core/
lib/ Drupal/ Core/ TypedData/ TypedDataManager.php
File
-
core/
lib/ Drupal/ Core/ TypedData/ TypedDataManager.php, line 107
Class
- TypedDataManager
- Manages data type plugins.
Namespace
Drupal\Core\TypedDataCode
public function create(DataDefinitionInterface $definition, $value = NULL, $name = NULL, $parent = NULL) {
$typed_data = $this->createInstance($definition->getDataType(), [
'data_definition' => $definition,
'name' => $name,
'parent' => $parent,
]);
if (isset($value)) {
$typed_data->setValue($value, FALSE);
}
return $typed_data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.