function EntityDataDefinition::getEntityTypeId

Gets the entity type ID.

Return value

string|null The entity type ID, or NULL if the entity type is unknown.

Overrides EntityDataDefinitionInterface::getEntityTypeId

2 calls to EntityDataDefinition::getEntityTypeId()
EntityDataDefinition::getDataType in core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
Returns the data type of the data.
EntityDataDefinition::getPropertyDefinitions in core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
Gets an array of property definitions of contained properties.

File

core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 119

Class

EntityDataDefinition
A typed data definition class for describing entities.

Namespace

Drupal\Core\Entity\TypedData

Code

public function getEntityTypeId() {
  return $this->definition['constraints']['EntityType'] ?? NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.