File tree Expand file tree Collapse file tree 2 files changed +32
-4
lines changed Expand file tree Collapse file tree 2 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 1616* [ Repositories] ( repos.md )
1717* [ Users] ( users.md )
1818
19- * [ Result Pager] ( result_pager.md )
20-
2119Additional features:
2220
21+ * [ Pagination support] ( result_pager.md )
2322* [ Authentication & Security] ( security.md )
2423* [ Request any Route] ( request_any_route.md )
2524* [ Customize ` php-github-api ` and testing] ( customize.md )
Original file line number Diff line number Diff line change 33
44### Usage examples
55
6- Get all results of a organization
6+ Get all repositories of a organization
77
88``` php
99$client = new Github\Client();
1010
1111$organizationApi = $client->api('organization');
1212
1313$paginator = new Github\ResultPager( $client );
14- $result = $paginator->fetchAll( $organizationApi, 'repositories', 'future500' );
14+ $result = $paginator->fetchAll( $organizationApi, 'repositories', 'github );
1515```
16+
17+ Get the first page
18+ ``` php
19+ $client = new Github\Client();
20+
21+ $organizationApi = $client->api('organization');
22+
23+ $paginator = new Github\ResultPager( $client );
24+ $result = $paginator->fetch( $organizationApi, 'repositories', 'github );
25+ ```
26+ Check for a next page:
27+ ``` php
28+ $paginator->hasNext();
29+ ```
30+
31+ Get next page:
32+ ``` php
33+ $paginator->fetchNext();
34+ ```
35+
36+ Check for pervious page:
37+ ``` php
38+ $paginator->getPrevious();
39+ ```
40+
41+ Get prevrious page:
42+ ``` php
43+ $paginator->fetchPrevious();
44+ ```
You can’t perform that action at this time.
0 commit comments