Loading core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php +17 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,11 @@ */ class EntityDataDefinition extends ComplexDataDefinitionBase implements EntityDataDefinitionInterface { /** * The data type for this entity. */ protected ?string $dataType; /** * Creates a new entity definition. * Loading Loading @@ -98,6 +103,9 @@ public function getPropertyDefinitions() { * {@inheritdoc} */ public function getDataType() { if (isset($this->dataType)) { return $this->dataType; } $type = 'entity'; if ($entity_type = $this->getEntityTypeId()) { $type .= ':' . $entity_type; Loading @@ -110,6 +118,7 @@ public function getDataType() { } } } $this->dataType = $type; return $type; } Loading Loading @@ -149,4 +158,12 @@ public function setBundles(?array $bundles = NULL) { return $this; } /** * {@inheritdoc} */ public function __sleep(): array { $this->dataType = NULL; return parent::__sleep(); } } Loading
core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php +17 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,11 @@ */ class EntityDataDefinition extends ComplexDataDefinitionBase implements EntityDataDefinitionInterface { /** * The data type for this entity. */ protected ?string $dataType; /** * Creates a new entity definition. * Loading Loading @@ -98,6 +103,9 @@ public function getPropertyDefinitions() { * {@inheritdoc} */ public function getDataType() { if (isset($this->dataType)) { return $this->dataType; } $type = 'entity'; if ($entity_type = $this->getEntityTypeId()) { $type .= ':' . $entity_type; Loading @@ -110,6 +118,7 @@ public function getDataType() { } } } $this->dataType = $type; return $type; } Loading Loading @@ -149,4 +158,12 @@ public function setBundles(?array $bundles = NULL) { return $this; } /** * {@inheritdoc} */ public function __sleep(): array { $this->dataType = NULL; return parent::__sleep(); } }