You are here

protected function RevisionTreeIndex::storeNodesId in Multiversion 8

Same name and namespace in other branches
  1. 8.2 src/Entity/Index/RevisionTreeIndex.php \Drupal\multiversion\Entity\Index\RevisionTreeIndex::storeNodesId()

Helper function to store all revision IDs in an array.

Parameters

array $tree: An associative array containing information about tree.

array $revision_ids: An array to store all revision ID.

1 call to RevisionTreeIndex::storeNodesId()
RevisionTreeIndex::getGraph in src/Entity/Index/RevisionTreeIndex.php

File

src/Entity/Index/RevisionTreeIndex.php, line 100

Class

RevisionTreeIndex
The revision tree index.

Namespace

Drupal\multiversion\Entity\Index

Code

protected function storeNodesId(array $tree, array &$revision_ids) {
  foreach ($tree as $value) {
    $current_id = $value['#rev'];
    $revision_ids[$current_id] = $current_id;
    if (count($value['children'])) {
      $this
        ->storeNodesId($value['children'], $revision_ids);
    }
  }
}