| @@ 331-347 (lines=17) @@ | ||
| 328 | * |
|
| 329 | * @return \Kunnu\Dropbox\Models\MetadataCollection |
|
| 330 | */ |
|
| 331 | public function listFolder($path = null, array $params = []) |
|
| 332 | { |
|
| 333 | //Specify the root folder as an |
|
| 334 | //empty string rather than as "/" |
|
| 335 | if ($path === '/') { |
|
| 336 | $path = ""; |
|
| 337 | } |
|
| 338 | ||
| 339 | //Set the path |
|
| 340 | $params['path'] = $path; |
|
| 341 | ||
| 342 | //Get File Metadata |
|
| 343 | $response = $this->postToAPI('/files/list_folder', $params); |
|
| 344 | ||
| 345 | //Make and Return the Model |
|
| 346 | return $this->makeModelFromResponse($response); |
|
| 347 | } |
|
| 348 | ||
| 349 | /** |
|
| 350 | * Paginate through all files and retrieve updates to the folder, |
|
| @@ 454-471 (lines=18) @@ | ||
| 451 | * |
|
| 452 | * @return \Kunnu\Dropbox\Models\SearchResults |
|
| 453 | */ |
|
| 454 | public function search($path, $query, array $params = []) |
|
| 455 | { |
|
| 456 | //Specify the root folder as an |
|
| 457 | //empty string rather than as "/" |
|
| 458 | if ($path === '/') { |
|
| 459 | $path = ""; |
|
| 460 | } |
|
| 461 | ||
| 462 | //Set the path and query |
|
| 463 | $params['path'] = $path; |
|
| 464 | $params['query'] = $query; |
|
| 465 | ||
| 466 | //Fetch Search Results |
|
| 467 | $response = $this->postToAPI('/files/search', $params); |
|
| 468 | ||
| 469 | //Make and Return the Model |
|
| 470 | return $this->makeModelFromResponse($response); |
|
| 471 | } |
|
| 472 | ||
| 473 | /** |
|
| 474 | * Create a folder at the given path |
|