Skip to content

Commit

Permalink
created pagination logic (fixes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
astepin authored Mar 1, 2024
1 parent af86338 commit 13a6305
Show file tree
Hide file tree
Showing 9 changed files with 450 additions and 243 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ $searchResults = $client->content()->find([
$createdPage = $searchResults->getResultAt(0);
```

#### Browse content with pagination
```php
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

$limit = 100;
$start = 10;

//Get the search results with pagination
$searchResults = $client->content()->find([
'spaceKey' => 'testSpaceKey',
'title' => 'Test'
], $limit, $start);

//check if there are more results
while(!$searchResults->isLastPage()) {
//get the next pages
$nextPages = $client->content()->find([
'spaceKey' => 'testSpaceKey',
'title' => 'Test'
], $limit, $searchResults->getStart() + $limit);
}
```

#### Fetch a page or comment by content id
```php
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */
Expand Down Expand Up @@ -88,11 +111,9 @@ $childContent = $client->content()->children($page, Content::CONTENT_TYPE_PAGE);
```php
use CloudPlayDev\ConfluenceClient\Api\Content;
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */
/* @var $page CloudPlayDev\ConfluenceClient\Entity\ContentPage */

//get child content
$pageId = 2323232323;
$historyData = $client->content()->history($pageId); //\CloudPlayDev\ConfluenceClient\Entity\ContentSearchResult
$historyData = $client->content()->history($pageId); // \CloudPlayDev\ConfluenceClient\Entity\ContentHistory
```

### Manipulating content
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cloudplaydev/confluence-php-client",
"description": "Provides methods for Confluence REST APIs",
"version": "0.5.0",
"version": "0.6.0",
"license": "MIT",
"keywords": [
"Atlassian",
Expand Down Expand Up @@ -35,7 +35,7 @@
"require": {
"php": "^7.4 || ^8.1",
"ext-json": "*",
"psr/http-message": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/http-client": "^1.0",
"psr/http-client-implementation": "^1.0",
"psr/http-factory": "^1.0",
Expand Down
Loading

0 comments on commit 13a6305

Please sign in to comment.