function EntityDataDefinition::getDataType
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::getDataType()
- 10 core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::getDataType()
- 11.x core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::getDataType()
Overrides DataDefinition::getDataType
File
-
core/
lib/ Drupal/ Core/ Entity/ TypedData/ EntityDataDefinition.php, line 100
Class
- EntityDataDefinition
- A typed data definition class for describing entities.
Namespace
Drupal\Core\Entity\TypedDataCode
public function getDataType() {
$type = 'entity';
if ($entity_type = $this->getEntityTypeId()) {
$type .= ':' . $entity_type;
// Append the bundle only if we know it for sure and it is not the default
// bundle.
if (($bundles = $this->getBundles()) && count($bundles) == 1) {
$bundle = reset($bundles);
if ($bundle != $entity_type) {
$type .= ':' . $bundle;
}
}
}
return $type;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.