function EntityRepositoryInterface::loadEntityByConfigTarget
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByConfigTarget()
- 10 core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByConfigTarget()
- 11.x core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByConfigTarget()
Loads an entity by the config target identifier.
Parameters
string $entity_type_id: The entity type ID to load from.
string $target: The configuration target to load, as returned from \Drupal\Core\Entity\EntityInterface::getConfigTarget().
Return value
\Drupal\Core\Entity\EntityInterface|null The entity object, or NULL if there is no entity with the given config target identifier.
Throws
\Drupal\Core\Entity\EntityStorageException Thrown if the target identifier is a UUID but the entity type does not support UUIDs.
See also
\Drupal\Core\Entity\EntityInterface::getConfigTarget()
2 methods override EntityRepositoryInterface::loadEntityByConfigTarget()
- EntityManager::loadEntityByConfigTarget in core/
lib/ Drupal/ Core/ Entity/ EntityManager.php - EntityRepository::loadEntityByConfigTarget in core/
lib/ Drupal/ Core/ Entity/ EntityRepository.php - Loads an entity by the config target identifier.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityRepositoryInterface.php, line 49
Class
- EntityRepositoryInterface
- Provides an interface for an entity repository.
Namespace
Drupal\Core\EntityCode
public function loadEntityByConfigTarget($entity_type_id, $target);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.