You are here

public function ContentEntityBase::id in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::id()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::id()

Gets the identifier.

Return value

string|int|null The entity identifier, or NULL if the object does not yet have an identifier.

Overrides EntityBase::id

13 calls to ContentEntityBase::id()
Comment::permalink in core/modules/comment/src/Entity/Comment.php
Returns the permalink URL for this comment.
ContentEntityBase::hasTranslationChanges in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Determines if the current translation of the entity has unsaved changes.
ContentEntityBase::isLatestRevision in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Checks if this entity is the latest revision.
ContentEntityBase::isLatestTranslationAffectedRevision in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Checks whether this is the latest revision affecting this translation.
Media::prepareSave in core/modules/media/src/Entity/Media.php
Sets the media entity's field values from the source's metadata.

... See full list

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 538

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function id() {
  return $this
    ->getEntityKey('id');
}