| @@ 339-355 (lines=17) @@ | ||
| 336 | * |
|
| 337 | * @return \Kunnu\Dropbox\Models\MetadataCollection |
|
| 338 | */ |
|
| 339 | public function listFolder($path = null, array $params = []) |
|
| 340 | { |
|
| 341 | //Specify the root folder as an |
|
| 342 | //empty string rather than as "/" |
|
| 343 | if ($path === '/') { |
|
| 344 | $path = ""; |
|
| 345 | } |
|
| 346 | ||
| 347 | //Set the path |
|
| 348 | $params['path'] = $path; |
|
| 349 | ||
| 350 | //Get File Metadata |
|
| 351 | $response = $this->postToAPI('/files/list_folder', $params); |
|
| 352 | ||
| 353 | //Make and Return the Model |
|
| 354 | return $this->makeModelFromResponse($response); |
|
| 355 | } |
|
| 356 | ||
| 357 | /** |
|
| 358 | * Paginate through all files and retrieve updates to the folder, |
|
| @@ 462-479 (lines=18) @@ | ||
| 459 | * |
|
| 460 | * @return \Kunnu\Dropbox\Models\SearchResults |
|
| 461 | */ |
|
| 462 | public function search($path, $query, array $params = []) |
|
| 463 | { |
|
| 464 | //Specify the root folder as an |
|
| 465 | //empty string rather than as "/" |
|
| 466 | if ($path === '/') { |
|
| 467 | $path = ""; |
|
| 468 | } |
|
| 469 | ||
| 470 | //Set the path and query |
|
| 471 | $params['path'] = $path; |
|
| 472 | $params['query'] = $query; |
|
| 473 | ||
| 474 | //Fetch Search Results |
|
| 475 | $response = $this->postToAPI('/files/search', $params); |
|
| 476 | ||
| 477 | //Make and Return the Model |
|
| 478 | return $this->makeModelFromResponse($response); |
|
| 479 | } |
|
| 480 | ||
| 481 | /** |
|
| 482 | * Create a folder at the given path |
|