| @@ 49-62 (lines=14) @@ | ||
| 46 | return $this->folder->getName(); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function getDirectoryListing() { |
|
| 50 | $listing = $this->folder->getDirectoryListing(); |
|
| 51 | ||
| 52 | $fileListing = array_map(function(Node $file) { |
|
| 53 | if ($file instanceof File) { |
|
| 54 | return new SimpleFile($file); |
|
| 55 | } |
|
| 56 | return null; |
|
| 57 | }, $listing); |
|
| 58 | ||
| 59 | $fileListing = array_filter($fileListing); |
|
| 60 | ||
| 61 | return array_values($fileListing); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function delete() { |
|
| 65 | $this->folder->delete(); |
|
| @@ 117-130 (lines=14) @@ | ||
| 114 | return new SimpleFolder($folder); |
|
| 115 | } |
|
| 116 | ||
| 117 | public function getDirectoryListing() { |
|
| 118 | $listing = $this->getAppDataFolder()->getDirectoryListing(); |
|
| 119 | ||
| 120 | $fileListing = array_map(function(Node $folder) { |
|
| 121 | if ($folder instanceof Folder) { |
|
| 122 | return new SimpleFolder($folder); |
|
| 123 | } |
|
| 124 | return null; |
|
| 125 | }, $listing); |
|
| 126 | ||
| 127 | $fileListing = array_filter($fileListing); |
|
| 128 | ||
| 129 | return array_values($fileListing); |
|
| 130 | } |
|
| 131 | } |
|
| 132 | ||