You are here

protected function SqlContentEntityStorage::doLoadRevisionFieldItems in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doLoadRevisionFieldItems()

Actually loads revision field item values from the storage.

Parameters

int|string $revision_id: The revision identifier.

Return value

\Drupal\Core\Entity\EntityInterface|null The specified entity revision or NULL if not found.

Overrides ContentEntityStorageBase::doLoadRevisionFieldItems

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 570
Contains \Drupal\Core\Entity\Sql\SqlContentEntityStorage.

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

protected function doLoadRevisionFieldItems($revision_id) {
  $revision = NULL;

  // Build and execute the query.
  $query_result = $this
    ->buildQuery(array(), $revision_id)
    ->execute();
  $records = $query_result
    ->fetchAllAssoc($this->idKey);
  if (!empty($records)) {

    // Convert the raw records to entity objects.
    $entities = $this
      ->mapFromStorageRecords($records, TRUE);
    $revision = reset($entities) ?: NULL;
  }
  return $revision;
}