public static function EntityBase::load in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::load()
- 9 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::load()
File
- core/
lib/ Drupal/ Core/ Entity/ EntityBase.php, line 484
Class
- EntityBase
- Defines a base entity class.
Namespace
Drupal\Core\EntityCode
public static function load($id) {
$entity_type_repository = \Drupal::service('entity_type.repository');
$entity_type_manager = \Drupal::entityTypeManager();
$storage = $entity_type_manager
->getStorage($entity_type_repository
->getEntityTypeFromClass(static::class));
return $storage
->load($id);
}