public function EntityStorageControllerBase::loadUnchanged

Loads an unchanged entity from the database.

@todo Remove this method once we have a reliable way to retrieve the unchanged entity from the entity object.

Parameters

mixed $id: The ID of the entity to load.

Return value

\Drupal\Core\Entity\EntityInterface The unchanged entity, or FALSE if the entity cannot be loaded.

Overrides EntityStorageControllerInterface::loadUnchanged

File

drupal/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php, line 90
Contains \Drupal\Core\Entity\EntityStorageControllerBase.

Class

EntityStorageControllerBase
A base entity storage controller class.

Namespace

Drupal\Core\Entity

Code

public function loadUnchanged($id) {
  $this
    ->resetCache(array(
    $id,
  ));
  $result = $this
    ->load(array(
    $id,
  ));
  return reset($result);
}