Exemplo n.º 1
0
 /**
  * Tests the building of a folder
  */
 public function testBuildFolder()
 {
     $data = json_decode($this->folderFixture, true);
     $folder = ContentBuilder::buildFolder($data);
     $this->assertInstanceOf('Ideneal\\OpenLoad\\Entity\\Folder', $folder);
 }
Exemplo n.º 2
0
 /**
  * Returns the folders within a folder
  *
  * @param string|Folder $folder The folder id
  *
  * @return Folder[]
  */
 public function getFolders($folder = null)
 {
     $params = $this->getAuthParams();
     if ($folder) {
         $params['folder'] = (string) $folder;
     }
     $response = $this->processRequest('file/listfolder', $params);
     $results = $this->processResponse($response);
     $contents = [];
     foreach ($results['folders'] as $result) {
         $contents[] = ContentBuilder::buildFolder($result);
     }
     return $contents;
 }