-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove support for
page
query params (#115)
Signed-off-by: Bruno Vieira <bruno@chartmogul.com>
- Loading branch information
Showing
12 changed files
with
138 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Upgrading to chartmogul-php 6.0.0 | ||
|
||
This new version replaces the existing pagination for the `.all()` endpoints that used a combination of `page` and `per_page` parameters, and instead uses a `cursor` based pagination. So to list (as an example) Plans you now can: | ||
|
||
```php | ||
// Getting the first page | ||
$plans = ChartMogul\Plan::all([ | ||
"per_page" => 1 | ||
]); | ||
|
||
// This will return an array of plans (if available), and a cursor + has_more fields | ||
{ | ||
"plans": [ | ||
{ | ||
"uuid": "some_uuid", | ||
"data_source_uuid": "some_uuid", | ||
"name": "Master Plan" | ||
} | ||
], | ||
"has_more": true, | ||
"cursor": "MjAyMy0wNy0yOFQwODowOToyMi4xNTQyMDMwMDBaJjk0NDQ0Mg==" | ||
} | ||
|
||
if ($plans->has_more) { | ||
$more_plans = ChartMogul\Plan::all([ | ||
"per_page" => 1, | ||
"cursor" => $plans->cursor | ||
]) | ||
} | ||
``` | ||
|
||
If you have existing code that relies on the `page` parameter, those requests will throw an error now alerting you of their deprecation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace ChartMogul\Exceptions; | ||
|
||
/** | ||
* DeprecatedParameterException Interface | ||
* | ||
* @codeCoverageIgnore | ||
*/ | ||
class DeprecatedParameterException extends ChartMogulException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.