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 16
16
* [Repositories](repos.md)
17
17
* [Users](users.md)
18
18
19
- * [Result Pager](result_pager.md)
20
-
21
19
Additional features:
22
20
21
+ * [Pagination support](result_pager.md)
23
22
* [Authentication & Security](security.md)
24
23
* [Request any Route](request_any_route.md)
25
24
* [Customize `php-github-api` and testing](customize.md)
Original file line number Diff line number Diff line change 3
3
4
4
### Usage examples
5
5
6
- Get all results of a organization
6
+ Get all repositories of a organization
7
7
8
8
```php
9
9
$client = new Github\Client();
10
10
11
11
$organizationApi = $client->api('organization');
12
12
13
13
$paginator = new Github\ResultPager( $client );
14
- $result = $paginator->fetchAll( $organizationApi, 'repositories', 'future500' );
14
+ $result = $paginator->fetchAll( $organizationApi, 'repositories', 'github );
15
15
```
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