Esempio n. 1
0
 /**
  * @param Folder $folder
  * @param int $start
  * @param int $maxNumberOfItems
  * @param bool $useFilters
  * @param bool $recursive
  *
  * @return Folder[]
  */
 public function getFoldersInFolder(Folder $folder, $start = 0, $maxNumberOfItems = 0, $useFilters = TRUE, $recursive = FALSE)
 {
     $filters = $useFilters == TRUE ? $this->fileAndFolderNameFilters : array();
     $folderIdentifiers = $this->driver->getFoldersInFolder($folder->getIdentifier(), $start, $maxNumberOfItems, $recursive, $filters);
     $processingIdentifier = $this->getProcessingFolder()->getIdentifier();
     if (isset($folderIdentifiers[$processingIdentifier])) {
         unset($folderIdentifiers[$processingIdentifier]);
     }
     $folders = array();
     foreach ($folderIdentifiers as $folderIdentifier) {
         $folders[$folderIdentifier] = $this->getFolder($folderIdentifier, TRUE);
     }
     return $folders;
 }
 /**
  * @param Folder $folder
  * @param int $start
  * @param int $maxNumberOfItems
  * @param bool $useFilters
  * @param bool $recursive
  * @param string $sort Property name used to sort the items.
  *                     Among them may be: '' (empty, no sorting), name,
  *                     fileext, size, tstamp and rw.
  *                     If a driver does not support the given property, it
  *                     should fall back to "name".
  * @param bool $sortRev TRUE to indicate reverse sorting (last to first)
  * @return Folder[]
  */
 public function getFoldersInFolder(Folder $folder, $start = 0, $maxNumberOfItems = 0, $useFilters = true, $recursive = false, $sort = '', $sortRev = false)
 {
     $filters = $useFilters == true ? $this->fileAndFolderNameFilters : array();
     $folderIdentifiers = $this->driver->getFoldersInFolder($folder->getIdentifier(), $start, $maxNumberOfItems, $recursive, $filters, $sort, $sortRev);
     // Exclude processing folders
     foreach ($this->getProcessingFolders() as $processingFolder) {
         $processingIdentifier = $processingFolder->getIdentifier();
         if (isset($folderIdentifiers[$processingIdentifier])) {
             unset($folderIdentifiers[$processingIdentifier]);
         }
     }
     $folders = array();
     foreach ($folderIdentifiers as $folderIdentifier) {
         $folders[$folderIdentifier] = $this->getFolder($folderIdentifier, true);
     }
     return $folders;
 }