PHP Class Tdt\Core\Pager

Author: Michiel Vancoillie ([email protected])
Author: Jan Vansteenlandt ([email protected])
Afficher le fichier Open project: tdt/core Class Usage Examples

Protected Properties

Свойство Type Description
$DEFAULT_PAGE_SIZE
$PAGING_KEYWORDS

Méthodes publiques

Méthode Description
buildQuerystring ( ) : string Build the query string from the request
calculateLimitAndOffset ( $limit = null ) Calculate the limit and offset based on the request string parameters.
calculatePagingHeaders ( integer $limit, integer $offset, integer $total_rows ) : array Calculate the link meta-data for paging purposes, return an array with paging information
setDefaultLimit ( $limit )

Méthodes protégées

Méthode Description
getLinkHeader ( $paging ) Provide paging headers in the response using the Link HTTP header.

Method Details

buildQuerystring() public static méthode

If not empty, will return &a=b&c=d
public static buildQuerystring ( ) : string
Résultat string

calculateLimitAndOffset() public static méthode

Calculate the limit and offset based on the request string parameters.
public static calculateLimitAndOffset ( $limit = null )

calculatePagingHeaders() public static méthode

Calculate the link meta-data for paging purposes, return an array with paging information
public static calculatePagingHeaders ( integer $limit, integer $offset, integer $total_rows ) : array
$limit integer
$offset integer
$total_rows integer The total amount of objects
Résultat array

getLinkHeader() protected static méthode

Provide paging headers in the response using the Link HTTP header.
protected static getLinkHeader ( $paging )

setDefaultLimit() public static méthode

public static setDefaultLimit ( $limit )

Property Details

$DEFAULT_PAGE_SIZE protected_oe static_oe property

protected static $DEFAULT_PAGE_SIZE

$PAGING_KEYWORDS protected_oe static_oe property

protected static $PAGING_KEYWORDS