PHP Class Prado\Data\SqlMap\DataMapper\TSqlMapPagedList

The maximum number of records fetched is 3 times the page size. It fetches the current, the previous and the next page at a time. This allows the paged list to determine if the page is a the begin, the middle or the end of the list. The paged list does not need to know about the total number of records.
Since: 3.1
Inheritance: extends Prado\Collections\TPagedList
Datei anzeigen Open project: pradosoft/prado

Public Methods

Method Description
__construct ( Prado\Data\SqlMap\Statements\IMappedStatement $statement, $parameter, $pageSize, $delegate = null, $page ) Create a new SqlMap paged list.
getIsLastPage ( ) : boolean
getIsMiddlePage ( ) : boolean
getIsNextPageAvailable ( ) : boolean
getIsPreviousPageAvailable ( ) : boolean
nextPage ( ) : integer | boolean Switches to the next page.
previousPage ( ) : integer | boolean Switches to the previous page.
setCustomPaging ( $value )

Protected Methods

Method Description
fetchDataFromStatement ( $sender, $param ) Fetch data by executing the SqlMap statement.
getOffsetAndLimit ( $param ) : array Calculate the data fetch offsets and limits.
initialize ( $statement, $parameter, $pageSize, $page ) Initialize the paged list.
populateData ( $param, $data ) Populate the list with the fetched data.

Method Details

__construct() public method

Create a new SqlMap paged list.
public __construct ( Prado\Data\SqlMap\Statements\IMappedStatement $statement, $parameter, $pageSize, $delegate = null, $page )
$statement Prado\Data\SqlMap\Statements\IMappedStatement

fetchDataFromStatement() protected method

Fetch data by executing the SqlMap statement.
protected fetchDataFromStatement ( $sender, $param )

getIsLastPage() public method

public getIsLastPage ( ) : boolean
return boolean true if is the very last page, false otherwise.

getIsMiddlePage() public method

public getIsMiddlePage ( ) : boolean
return boolean true if is not first nor last page, false otherwise.

getIsNextPageAvailable() public method

public getIsNextPageAvailable ( ) : boolean
return boolean true if the next page is available, false otherwise.

getIsPreviousPageAvailable() public method

public getIsPreviousPageAvailable ( ) : boolean
return boolean true if the previous page is available, false otherwise.

getOffsetAndLimit() protected method

Calculate the data fetch offsets and limits.
protected getOffsetAndLimit ( $param ) : array
return array 1st element is the offset, 2nd element is the limit.

initialize() protected method

Initialize the paged list.
protected initialize ( $statement, $parameter, $pageSize, $page )

nextPage() public method

Switches to the next page.
public nextPage ( ) : integer | boolean
return integer | boolean the new page index, false if next page is not availabe.

populateData() protected method

Populate the list with the fetched data.
protected populateData ( $param, $data )

previousPage() public method

Switches to the previous page.
public previousPage ( ) : integer | boolean
return integer | boolean the new page index, false if previous page is not availabe.

setCustomPaging() public method

public setCustomPaging ( $value )