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