Esempio n. 1
0
 /**
  * Take an array of Folders, and create the Folders
  * 
  * Each array will have a path element for the path
  * and then a Folders element whose entries are other
  * path arrays.  An empty array ends the sequence
  * 
  * Very recursive
  * 
  * @param array $build Not an array of Folders, but as above
  * 
  */
 public static function buildFromArray($build = array())
 {
     $firstKey = array_keys($build);
     $firstKey = $firstKey[0];
     $ret = new Folder($build[$firstKey]['data'], $firstKey);
     foreach ($build[$firstKey]['folders'] as $key => $folder) {
         $ret->addFolder(Folder::buildFromArray(array($key => $folder)));
     }
     return $ret;
 }