Jet\Data_Paginator_DataSource

The pager interface that must be implemented by the class that is to serve as the data source for the pager. By default, this interface is implemented by some DataModel classes.

The class that implements this interface must itself be an iterator. The paginator does the service for the class of taking care of the calculations and generation (e.g. URLs) needed for the paginator, and passes information to the class about what data section (offset and limit) the class should pass when iterating. However, this is entirely the responsibility of the class.

Method Overview

Method Meaning of
public getCount(
): int
This class gives the paginator information what is the total number of items in the paginated list of data.
public setPagination(
int $limit,
int $offset
): void
The paginator uses this method to inform the class about the paging result - that is, how much data and from what offset to return during the iteration.
Previous chapter
Data Paginator - Jet\Data_Paginator
Next chapter
Jet\Data_Paginator_Exception