Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

The EntityStorageControllerInterface::loadUnchanged() has been added as the OO counterpart of entity_load_unchanged(), which now just forwards the call to the storage controller. As before the returned value is the entity as currently stored.

Before:

<?php
class ClassDealingWithEntities {

  public function doStuff(EntityInterface $entity) {
    // Bad, not properly unit-testable.
    $unchanged_entity = entity_load_unchanged($entity->id());
    // ...
  }

}
?>

After:

<?php
class ClassDealingWithEntities {

  protected $manager;

  public function __construct(EntityManagerInterface $manager) {
     $this->manager = $manager;
  }

  public function doStuff(EntityInterface $entity) {
    $unchanged_entity = $this->manager
      ->getStorageController($entity->entityType())
      ->loadUnchanged($entity->id());
    // ...
  }

}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done