protected function Importer::sortTree in Default Content for D8 8
Same name and namespace in other branches
- 2.0.x src/Importer.php \Drupal\default_content\Importer::sortTree()
Sorts dependencies tree.
Parameters
array $graph: Array of dependencies.
Return value
array Array of sorted dependencies.
1 call to Importer::sortTree()
- Importer::importContent in src/
Importer.php - Imports default content from a given module.
File
- src/
Importer.php, line 233
Class
- Importer
- A service for handling import of default content.
Namespace
Drupal\default_contentCode
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);
}