doLoadMultipleRevisionsFieldItems example


  public function loadRevision($revision_id) {
    $revisions = $this->loadMultipleRevisions([$revision_id]);

    return $revisions[$revision_id] ?? NULL;
  }

  /** * {@inheritdoc} */
  public function loadMultipleRevisions(array $revision_ids) {
    $revisions = $this->doLoadMultipleRevisionsFieldItems($revision_ids);

    // The hooks are executed with an array of entities keyed by the entity ID.     // As we could load multiple revisions for the same entity ID at once we     // have to build groups of entities where the same entity ID is present only     // once.     $entity_groups = [];
    $entity_group_mapping = [];
    foreach ($revisions as $revision) {
      $entity_id = $revision->id();
      $entity_group_key = isset($entity_group_mapping[$entity_id]) ? $entity_group_mapping[$entity_id] + 1 : 0;
      $entity_group_mapping[$entity_id] = $entity_group_key;
      
Home | Imprint | This part of the site doesn't use cookies.