public EntityDataDefinition::getDataType()
Returns the data type of the data.
Return value
string The data type.
Overrides DataDefinition::getDataType
File
- core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 83
Class
- EntityDataDefinition
- A typed data definition class for describing entities.
Namespace
Drupal\Core\Entity\TypedData
Code
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; }
Please login to continue.