diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 1c55208..0bad9af 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -354,7 +354,7 @@ public function __wakeup() { */ public function id() { if (!isset($this->idKeyName)) { - $this->idKeyName = $this->entityInfo()->getKey('id'); + $this->idKeyName = $this->getEntityType()->getKey('id'); } return $this->get($this->idKeyName)->value; } diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index b52c5ca..c656316 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -72,7 +72,7 @@ public function __construct(array $values, $entity_type) { */ public function id() { if (!isset($this->idKeyName)) { - $this->idKeyName = $this->entityInfo()->getKey('id'); + $this->idKeyName = $this->getEntityType()->getKey('id'); } return isset($this->{$this->idKeyName}) ? $this->{$this->idKeyName} : NULL; }