## Class TSqlMapPagedList

Description

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.

- since: 3.1
- version: $Id: TSqlMapPagedList.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /Data/SqlMap/DataMapper/TSqlMapPagedList.php (line 30)

    TComponent
       |
       --TList
          |
          --TPagedList
             |
             --TSqlMapPagedList

Method Summary
TSqlMapPagedList __construct (IMappedStatement $statement, mixed $parameter, int $pageSize, [mixed $delegate = null], int $page)
void fetchDataFromStatement (TPageList $sender, TPagedListFetchDataEventParameter $param)
boolean getIsLastPage ()
boolean getIsMiddlePage ()
boolean getIsNextPageAvailable ()
boolean getIsPreviousPageAvailable ()
array getOffsetAndLimit (TPagedListFetchDataEventParameter $param)
void initialize (IMappedStatement $statement, mixed $parameter, int $pageSize, int $page)
integer|boolean nextPage ()
void populateData (TPagedListFetchDataEventParameter $param, array $data)
integer|boolean previousPage ()
void setCustomPaging (mixed $value)
Methods
Constructor __construct (line 46)

Create a new SqlMap paged list.

- access: public

TSqlMapPagedList __construct (IMappedStatement $statement, mixed $parameter, int $pageSize, [mixed $delegate = null], int $page)

- IMappedStatement $statement: SqlMap statement.
- mixed $parameter: query parameters
- int $pageSize: page size
- mixed $delegate: delegate for each data row retrieved.
- int $page: number of page to fetch on initialization

Redefinition of:

TPagedList::__construct()
  Constructor.

fetchDataFromStatement (line 83)

Fetch data by executing the SqlMap statement.

- access: protected

void fetchDataFromStatement (TPageList $sender, TPagedListFetchDataEventParameter $param)

- TPageList $sender: current object.
- TPagedListFetchDataEventParameter $param: fetch parameters

getIsLastPage (line 195)

- return: true if is the very last page, false otherwise.
- access: public

boolean getIsLastPage ()

Redefinition of:

TPagedList::getIsLastPage()

getIsMiddlePage (line 203)

- return: true if is not first nor last page, false otherwise.
- access: public

boolean getIsMiddlePage ()
getIsNextPageAvailable (line 179)

- return: true if the next page is available, false otherwise.
- access: public

boolean getIsNextPageAvailable ()
getIsPreviousPageAvailable (line 187)

- return: true if the previous page is available, false otherwise.
- access: public

boolean getIsPreviousPageAvailable ()
getOffsetAndLimit (line 169)

Calculate the data fetch offsets and limits.

- return: 1st element is the offset, 2nd element is the limit.
- access: protected

array getOffsetAndLimit (TPagedListFetchDataEventParameter $param)

- TPagedListFetchDataEventParameter $param: fetch parameters

initialize (line 61)

Initialize the paged list.

- access: protected

void initialize (IMappedStatement $statement, mixed $parameter, int $pageSize, int $page)

- IMappedStatement $statement: SqlMap statement.
- mixed $parameter: query parameters
- int $pageSize: page size.
- int $page: number of page.

nextPage (line 96)

Switches to the next page.

- return: the new page index, false if next page is not availabe.
- access: public

integer|boolean nextPage ()

Redefinition of:

TPagedList::nextPage()
  Switches to the next page.

populateData (line 115)

Populate the list with the fetched data.

- access: protected

void populateData (TPagedListFetchDataEventParameter $param, array $data)

- TPagedListFetchDataEventParameter $param: fetch parameters
- array $data: fetched data.

previousPage (line 105)

Switches to the previous page.

- return: the new page index, false if previous page is not availabe.
- access: public

integer|boolean previousPage ()

Redefinition of:

TPagedList::previousPage()
  Switches to the previous page.

setCustomPaging (line 73)

- access: public
- throws: TSqlMapException custom paging must be enabled.

void setCustomPaging (mixed $value)

Redefinition of:

TPagedList::setCustomPaging()

#### Inherited Methods

Inherited From TPagedList

> TPagedList::__construct()
> 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()

Inherited From TList

> TList::__construct()
> 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()

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()

Documentation generated on Mon, 22 Feb 2010 12:18:42 +0000 by phpDocumentor 1.3.0RC4