You are here

public function EntityBase::uuid in Drupal 9

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

Gets the entity UUID (Universally Unique Identifier).

The UUID is guaranteed to be unique and can be used to identify an entity across multiple systems.

Return value

string|null The UUID of the entity, or NULL if the entity does not have one.

Overrides EntityInterface::uuid

5 calls to EntityBase::uuid()
ConfigEntityBase::preSave in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Acts on an entity before the presave hook is invoked.
EntityBase::getConfigDependencyName in core/lib/Drupal/Core/Entity/EntityBase.php
Gets the configuration dependency name.
EntityBase::getConfigTarget in core/lib/Drupal/Core/Entity/EntityBase.php
Gets the configuration target identifier for the entity.
FieldConfig::getUniqueIdentifier in core/modules/field/src/Entity/FieldConfig.php
Returns a unique identifier for the field.
FieldStorageConfig::getUniqueStorageIdentifier in core/modules/field/src/Entity/FieldStorageConfig.php
Returns a unique identifier for the field storage.
1 method overrides EntityBase::uuid()
ContentEntityBase::uuid in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets the entity UUID (Universally Unique Identifier).

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 113

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

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