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 583

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;
}
doc_Drupal
2016-10-29 09:43:22
Comments
Leave a Comment

Please login to continue.