function EntityRepositoryInterface::loadEntityByUuid

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByUuid()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByUuid()
  3. 11.x core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByUuid()

Loads an entity by UUID.

Note that some entity types may not support UUIDs.

Parameters

string $entity_type_id: The entity type ID to load from.

string $uuid: The UUID of the entity to load.

Return value

\Drupal\Core\Entity\EntityInterface|null The entity object, or NULL if there is no entity with the given UUID.

Throws

\Drupal\Core\Entity\EntityStorageException Thrown in case the requested entity type does not support UUIDs.

File

core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php, line 34

Class

EntityRepositoryInterface
Provides an interface for an entity repository.

Namespace

Drupal\Core\Entity

Code

public function loadEntityByUuid($entity_type_id, $uuid);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.