Class TSqlMapPagedList
TSqlMapPagedList implements a list with paging functionality that retrieves data from a SqlMap statement.
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.
Constructor Summary |
public |
Create a new SqlMap paged list.
|
Method Summary |
protected
void
|
Fetch data by executing the SqlMap statement.
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
protected
array
|
Calculate the data fetch offsets and limits.
|
protected
void
|
Initialize the paged list.
|
integer|boolean
|
Switches to the next page.
|
protected
void
|
Populate the list with the fetched data.
|
integer|boolean
|
Switches to the previous page.
|
void
|
|
Methods Inherited From TPagedList |
TPagedList::getCount(), TPagedList::getCurrentPageIndex(), TPagedList::getCustomPaging(), TPagedList::getIsFirstPage(), TPagedList::getIsLastPage(), TPagedList::getIterator(), TPagedList::getPageCount(), TPagedList::getPageSize(), TPagedList::getVirtualCount(), TPagedList::gotoPage(), TPagedList::indexOf(), TPagedList::itemAt(), TPagedList::nextPage(), TPagedList::offsetExists(), TPagedList::offsetGet(), TPagedList::onFetchData(), TPagedList::onPageIndexChanged(), TPagedList::previousPage(), TPagedList::setCurrentPageIndex(), TPagedList::setCustomPaging(), TPagedList::setPageSize(), TPagedList::setVirtualCount(), TPagedList::toArray()
|
Methods Inherited From TList |
TList::add(), TList::clear(), TList::contains(), TList::copyFrom(), TList::count(), TList::getCount(), TList::getIterator(), TList::getReadOnly(), TList::indexOf(), TList::insertAt(), TList::itemAt(), TList::mergeWith(), TList::offsetExists(), TList::offsetGet(), TList::offsetSet(), TList::offsetUnset(), TList::remove(), TList::removeAt(), TList::setReadOnly(), TList::toArray()
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Constructor Details |
__construct
Create a new SqlMap paged list.
|
Method Details |
fetchDataFromStatement
Fetch data by executing the SqlMap statement.
|
getIsLastPage
public boolean getIsLastPage |
() |
Output |
boolean
| true if is the very last page, false otherwise. |
Exception |
|
getIsMiddlePage
public boolean getIsMiddlePage |
() |
Output |
boolean
| true if is not first nor last page, false otherwise. |
Exception |
|
getIsNextPageAvailable
public boolean getIsNextPageAvailable |
() |
Output |
boolean
| true if the next page is available, false otherwise. |
Exception |
|
getIsPreviousPageAvailable
public boolean getIsPreviousPageAvailable |
() |
Output |
boolean
| true if the previous page is available, false otherwise. |
Exception |
|
getOffsetAndLimit
Calculate the data fetch offsets and limits.
|
initialize
protected void initialize |
(IMappedStatement $statement , mixed $parameter , int $pageSize , int $page ) |
Initialize the paged list.
Input |
IMappedStatement | $statement | SqlMap statement. |
mixed | $parameter | query parameters |
int | $pageSize | page size. |
int | $page | number of page. |
Output |
Exception |
|
nextPage
public integer|boolean nextPage |
() |
Switches to the next page.
Output |
integer|boolean
| the new page index, false if next page is not availabe. |
Exception |
|
populateData
Populate the list with the fetched data.
|
previousPage
public integer|boolean previousPage |
() |
Switches to the previous page.
Output |
integer|boolean
| the new page index, false if previous page is not availabe. |
Exception |
|
setCustomPaging
public void setCustomPaging |
(mixed $value ) |
Input |
mixed | $value | |
Output |
Exception |
throws | TSqlMapException custom paging must be enabled. |
|
|