PHP Class PDO4You\Pagination

Since: 2010-09-07
Author: Giovanni Ramos ([email protected])
Mostra file Open project: giovanniramos/pdo4you Class Usage Examples

Public Properties

Property Type Description
$buttons

Public Methods

Method Description
buildQuery ( string $query, array $records ) : string Builds a query and sets the number of records per page
getPagination ( ) : null | string Displays the pagination
getPaging ( ) : boolean Gets the activation of pagination
getTotalOfRecords ( ) : integer Gets the total number of records
setFriendlyUrl ( boolean $friendly_url ) Enables navigation by URLs friendlies
setLimitPerPage ( integer $limit ) Sets the number of records per page
setPagination ( boolean $friendly_url = false ) Sets the activation of paging
setPaginator ( string $paginator ) Sets the paginator

Private Methods

Method Description
buildPaginator ( integer $page ) : string Builds the paginator
getCurrentPage ( ) : integer Get the number of the current page
getLimitPerPage ( ) : integer Gets the number of records per page
getTotalOfPages ( ) Gets the total number of pages
setPaging ( boolean $paging ) Enables paging of records
setTotalOfPages ( integer $limit ) Sets the total number of pages
setTotalOfRecords ( array $records ) Sets the total number of records

Method Details

buildQuery() public static method

Builds a query and sets the number of records per page
See also: PDO4You::selectRecords()
public static buildQuery ( string $query, array $records ) : string
$query string SQL query
$records array Records of the query
return string

getPagination() public static method

Displays the pagination
public static getPagination ( ) : null | string
return null | string

getPaging() public static method

Gets the activation of pagination
See also: PDO4You::selectRecords()
public static getPaging ( ) : boolean
return boolean

getTotalOfRecords() public static method

Gets the total number of records
public static getTotalOfRecords ( ) : integer
return integer

setFriendlyUrl() public static method

Enables navigation by URLs friendlies
public static setFriendlyUrl ( boolean $friendly_url )
$friendly_url boolean Enables URLs friendlies

setLimitPerPage() public static method

Sets the number of records per page
public static setLimitPerPage ( integer $limit )
$limit integer Maximum of records per page

setPagination() public static method

Sets the activation of paging
public static setPagination ( boolean $friendly_url = false )
$friendly_url boolean OPTIONAL Enables URLs friendlies

setPaginator() public static method

Sets the paginator
public static setPaginator ( string $paginator )
$paginator string Parameter used as paginator

Property Details

$buttons public_oe static_oe property

public static $buttons