Class PaginatedResultSet
Paginated result set.
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<TKey, TValue> $results, array $params)
Constructor
Parameters
-
Traversable<TKey, TValue>$results Resultset instance.
-
array$params Paging params.
items() ¶ public
items(): Traversable<TKey, TValue>
Get paginated items.
Returns
Traversable<TKey, TValue>The paginated items result set.
jsonSerialize() ¶ public
jsonSerialize(): array
Provide data which should be serialized to JSON.
Returns
arraypagingParam() ¶ public
pagingParam(string $name): mixed
Get paging param.
Parameters
-
string$name
Returns
mixedtoArray() ¶ public
toArray(): array<array-key, TValue>
Get the paginated items as an array.
This will exhaust the iterator items.
Returns
array<array-key, TValue>