W3cubDocs

/Drupal 8

protected function SqlContentEntityStorage::doLoadRevisionFieldItems

protected SqlContentEntityStorage::doLoadRevisionFieldItems($revision_id)

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 569

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Sql!SqlContentEntityStorage.php/function/SqlContentEntityStorage::doLoadRevisionFieldItems/8.1.x