entity_load($entity_type, $id, $reset = FALSE)
Loads an entity from the database.
\Drupal::entityTypeManager()->getStorage($entity_type)->load($id);
Parameters
string $entity_type: The entity type to load, e.g. node or user.
mixed $id: The id of the entity to load.
bool $reset: Whether to reset the internal cache for the requested entity type.
Return value
\Drupal\Core\Entity\EntityInterface|null The entity object, or NULL if there is no entity with the given ID.
Deprecated in Drupal