PaginatedResponse
in package
Table of Contents
Properties
- $client : Client
- $currentPage : int
- $data : array<int, mixed>
- $endpoint : string
- $params : array<string, mixed>
- $total : int
- $totalPages : int
Methods
- __construct() : mixed
- getCurrentPage() : int
- Get current page number
- getData() : array<int, mixed>
- Get the data for current page
- getTotal() : int
- Get total number of items
- getTotalPages() : int
- Get total number of pages
- hasNextPage() : bool
- Check if there is a next page
- hasPreviousPage() : bool
- Check if there is a previous page
- nextPage() : self|null
- Fetch the next page, or null if this is the last page.
- previousPage() : self|null
- Fetch the previous page, or null if this is the first page.
- fetchPage() : self
- Fetch a specific page, mapping transport errors to SDK exceptions.
Properties
$client
private
Client
$client
$currentPage
private
int
$currentPage
$data
private
array<int, mixed>
$data
$endpoint
private
string
$endpoint
$params
private
array<string, mixed>
$params
$total
private
int
$total
$totalPages
private
int
$totalPages
Methods
__construct()
public
__construct(ResponseInterface $response, array<int, mixed> $data, Client $client, string $endpoint[, array<string, mixed> $params = [] ]) : mixed
Parameters
- $response : ResponseInterface
- $data : array<int, mixed>
- $client : Client
- $endpoint : string
- $params : array<string, mixed> = []
getCurrentPage()
Get current page number
public
getCurrentPage() : int
Return values
intgetData()
Get the data for current page
public
getData() : array<int, mixed>
Return values
array<int, mixed>getTotal()
Get total number of items
public
getTotal() : int
Return values
intgetTotalPages()
Get total number of pages
public
getTotalPages() : int
Return values
inthasNextPage()
Check if there is a next page
public
hasNextPage() : bool
Return values
boolhasPreviousPage()
Check if there is a previous page
public
hasPreviousPage() : bool
Return values
boolnextPage()
Fetch the next page, or null if this is the last page.
public
nextPage() : self|null
Tags
Return values
self|nullpreviousPage()
Fetch the previous page, or null if this is the first page.
public
previousPage() : self|null
Tags
Return values
self|nullfetchPage()
Fetch a specific page, mapping transport errors to SDK exceptions.
private
fetchPage(int $page) : self
Parameters
- $page : int