public static function Entity::load in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Entity.php \Drupal\Core\Entity\Entity::load()
Return value
static|null The entity object or NULL if there is no entity with the given ID.
Overrides EntityInterface::load
File
- core/
lib/ Drupal/ Core/ Entity/ Entity.php, line 504 - Contains \Drupal\Core\Entity\Entity.
Class
- Entity
- Defines a base entity class.
Namespace
Drupal\Core\EntityCode
public static function load($id) {
$entity_manager = \Drupal::entityManager();
return $entity_manager
->getStorage($entity_manager
->getEntityTypeFromClass(get_called_class()))
->load($id);
}