8.5.x Entity.php Entity::id()
8.0.x Entity.php Entity::id()
8.1.x Entity.php Entity::id()
8.2.x Entity.php Entity::id()
8.3.x Entity.php Entity::id()
8.4.x Entity.php Entity::id()
8.6.x Entity.php Entity::id()

Gets the identifier.

Return value

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

Overrides EntityInterface::id

16 calls to Entity::id()
ConfigEntityBase::getConfigDependencyName in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Gets the configuration dependency name.
ConfigEntityBase::getConfigTarget in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Gets the configuration target identifier for the entity.
ConfigEntityBase::toArray in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Gets an array of all property values.
ConfigEntityBase::__construct in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Constructs an Entity object.
ConfigEntityBundleBase::postSave in core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php
Acts on a saved entity before the insert or update hook is invoked.

... See full list

11 methods override Entity::id()
ContentEntityBase::id in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets the identifier.
ContentLanguageSettings::id in core/modules/language/src/Entity/ContentLanguageSettings.php
Gets the identifier.
Editor::id in core/modules/editor/src/Entity/Editor.php
Gets the identifier.
EntityDisplayBase::id in core/lib/Drupal/Core/Entity/EntityDisplayBase.php
Gets the identifier.
FieldConfigBase::id in core/lib/Drupal/Core/Field/FieldConfigBase.php
Gets the identifier.

... See full list

File

core/lib/Drupal/Core/Entity/Entity.php, line 111

Class

Entity
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function id() {
  return isset($this->id) ? $this->id : NULL;
}