| @@ 345-361 (lines=17) @@ | ||
| 342 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder |
|
| 343 | * |
|
| 344 | */ |
|
| 345 | public function listFolder($path = null, array $params = []) |
|
| 346 | { |
|
| 347 | //Specify the root folder as an |
|
| 348 | //empty string rather than as "/" |
|
| 349 | if ($path === '/') { |
|
| 350 | $path = ""; |
|
| 351 | } |
|
| 352 | ||
| 353 | //Set the path |
|
| 354 | $params['path'] = $path; |
|
| 355 | ||
| 356 | //Get File Metadata |
|
| 357 | $response = $this->postToAPI('/files/list_folder', $params); |
|
| 358 | ||
| 359 | //Make and Return the Model |
|
| 360 | return $this->makeModelFromResponse($response); |
|
| 361 | } |
|
| 362 | ||
| 363 | /** |
|
| 364 | * Paginate through all files and retrieve updates to the folder, |
|
| @@ 468-485 (lines=18) @@ | ||
| 465 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-search |
|
| 466 | * |
|
| 467 | */ |
|
| 468 | public function search($path, $query, array $params = []) |
|
| 469 | { |
|
| 470 | //Specify the root folder as an |
|
| 471 | //empty string rather than as "/" |
|
| 472 | if ($path === '/') { |
|
| 473 | $path = ""; |
|
| 474 | } |
|
| 475 | ||
| 476 | //Set the path and query |
|
| 477 | $params['path'] = $path; |
|
| 478 | $params['query'] = $query; |
|
| 479 | ||
| 480 | //Fetch Search Results |
|
| 481 | $response = $this->postToAPI('/files/search', $params); |
|
| 482 | ||
| 483 | //Make and Return the Model |
|
| 484 | return $this->makeModelFromResponse($response); |
|
| 485 | } |
|
| 486 | ||
| 487 | /** |
|
| 488 | * Create a folder at the given path |
|