/** * Gets the parent collection names for each route collection. * * @return array An array where the key is the collection name and the * value is an array of the parent collection names. */ protected function _getCollectionHierarchy() { $parents = array(); foreach ($this as $collectionName => $collection) { $parents[$collectionName] = $collection->getParent(); } $tree = Iterable::toTree($parents); $keys = Iterable::arrayKeysMultidimensional($tree); $result = array(); foreach ($keys as $key) { $result[$key] = array_merge((array) Iterable::getParentsFromKey($key, $tree), array($key)); } return $result; }