function SqlContentEntityStorage::doLoadMultipleRevisionsFieldItems

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doLoadMultipleRevisionsFieldItems()
  2. 8.9.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doLoadMultipleRevisionsFieldItems()
  3. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doLoadMultipleRevisionsFieldItems()

Overrides ContentEntityStorageBase::doLoadMultipleRevisionsFieldItems

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 614

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

protected function doLoadMultipleRevisionsFieldItems($revision_ids) {
    $revisions = [];
    // Sanitize IDs. Before feeding ID array into buildQuery, check whether
    // it is empty as this would load all entity revisions.
    $revision_ids = $this->cleanIds($revision_ids, 'revision');
    if (!empty($revision_ids)) {
        // Build and execute the query.
        $query_result = $this->buildQuery(NULL, $revision_ids)
            ->execute();
        $records = $query_result->fetchAllAssoc($this->revisionKey);
        // Map the loaded records into entity objects and according fields.
        if ($records) {
            $revisions = $this->mapFromStorageRecords($records, TRUE);
        }
    }
    return $revisions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.