function getFolderList(Asset_Folder $rootFolder, &$folderList = array()) { if ($rootFolder->getParent()) { $folderList[] = array("parent" => $rootFolder->getParent()->getFullPath(), "key" => $rootFolder->getKey()); } foreach ($rootFolder->getChilds() as $childFolder) { if ($childFolder instanceof Asset_Folder) { getFolderList($childFolder, $folderList); } } }