You are here

protected function DefaultContentManager::sortTree in Default Content 8

1 call to DefaultContentManager::sortTree()
DefaultContentManager::getFilesInOrder in src/DefaultContentManager.php

File

src/DefaultContentManager.php, line 263
Contains \Drupal\defaultcontent\DefaultContentManager. @todo remove all references to linkmanager?

Class

DefaultContentManager
A service for handling import of default content. @todo throw useful exceptions

Namespace

Drupal\defaultcontent

Code

protected function sortTree(array $graph) {
  $graph_object = new Graph($graph);
  $sorted = $graph_object
    ->searchAndSort();
  uasort($sorted, 'Drupal\\Component\\Utility\\SortArray::sortByWeightElement');
  return array_reverse($sorted);
}