Skip to content

Commit 13a6305

Browse files
authored
created pagination logic (fixes #1)
1 parent af86338 commit 13a6305

File tree

9 files changed

+450
-243
lines changed

9 files changed

+450
-243
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,29 @@ $searchResults = $client->content()->find([
5858
$createdPage = $searchResults->getResultAt(0);
5959
```
6060

61+
#### Browse content with pagination
62+
```php
63+
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */
64+
65+
$limit = 100;
66+
$start = 10;
67+
68+
//Get the search results with pagination
69+
$searchResults = $client->content()->find([
70+
'spaceKey' => 'testSpaceKey',
71+
'title' => 'Test'
72+
], $limit, $start);
73+
74+
//check if there are more results
75+
while(!$searchResults->isLastPage()) {
76+
//get the next pages
77+
$nextPages = $client->content()->find([
78+
'spaceKey' => 'testSpaceKey',
79+
'title' => 'Test'
80+
], $limit, $searchResults->getStart() + $limit);
81+
}
82+
```
83+
6184
#### Fetch a page or comment by content id
6285
```php
6386
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */
@@ -88,11 +111,9 @@ $childContent = $client->content()->children($page, Content::CONTENT_TYPE_PAGE);
88111
```php
89112
use CloudPlayDev\ConfluenceClient\Api\Content;
90113
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */
91-
/* @var $page CloudPlayDev\ConfluenceClient\Entity\ContentPage */
92114

93-
//get child content
94115
$pageId = 2323232323;
95-
$historyData = $client->content()->history($pageId); //\CloudPlayDev\ConfluenceClient\Entity\ContentSearchResult
116+
$historyData = $client->content()->history($pageId); // \CloudPlayDev\ConfluenceClient\Entity\ContentHistory
96117
```
97118

98119
### Manipulating content

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cloudplaydev/confluence-php-client",
33
"description": "Provides methods for Confluence REST APIs",
4-
"version": "0.5.0",
4+
"version": "0.6.0",
55
"license": "MIT",
66
"keywords": [
77
"Atlassian",
@@ -35,7 +35,7 @@
3535
"require": {
3636
"php": "^7.4 || ^8.1",
3737
"ext-json": "*",
38-
"psr/http-message": "^1.0",
38+
"psr/http-message": "^1.0 || ^2.0",
3939
"psr/http-client": "^1.0",
4040
"psr/http-client-implementation": "^1.0",
4141
"psr/http-factory": "^1.0",

0 commit comments

Comments
 (0)