Class PaginatedResultSet
Paginated resultset.
Namespace: Cake\Datasource\Paging
Property Summary
Method Summary
-
__call() public
Proxies method calls to internal result set instance.
-
__construct() public
Constructor
-
count() public
-
currentPage() public
Get current page number.
-
getIterator() public
-
hasNextPage() public
Get whether there's a next page.
-
hasPrevPage() public
Get whether there's a previous page.
-
items() public
Get paginated items.
-
jsonSerialize() public
Provide data which should be serialized to JSON.
-
pageCount() public
Get total page count.
-
pagingParam() public
Get paging param.
-
pagingParams() public
Get all paging params.
-
perPage() public
Get items per page.
-
toArray() public
Get the paginated items as an array.
-
totalCount() public
Get Total items counts.
Method Detail
__call() ¶ public
__call(string $name, array $arguments): mixed
Proxies method calls to internal result set instance.
Parameters
-
string
$name Method name
-
array
$arguments Arguments
Returns
mixed
__construct() ¶ public
__construct(Traversable<T> $results, array $params)
Constructor
Parameters
-
Traversable<T>
$results Resultset instance.
-
array
$params Paging params.
jsonSerialize() ¶ public
jsonSerialize(): array
Provide data which should be serialized to JSON.
Returns
array
pagingParam() ¶ public
pagingParam(string $name): mixed
Get paging param.
Parameters
-
string
$name
Returns
mixed
toArray() ¶ public
toArray(): array<array-key, T>
Get the paginated items as an array.
This will exhaust the iterator items
.
Returns
array<array-key, T>