## 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 1568 2006-12-09 09:17:22Z wei $
- 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])
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)
integer|boolean nextPage ()
void populateData (TPagedListFetchDataEventParameter $param, array $data)
integer|boolean previousPage ()
void setCustomPaging (mixed $value)
Methods
Constructor __construct (line 45)

Create a new SqlMap paged list.

- access: public

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

- IMappedStatement $statement: SqlMap statement.
- mixed $parameter: query parameters
- int $pageSize: page size
- mixed $delegate: delegate for each data row retrieved.

Redefinition of:

TPagedList::__construct()
  Constructor.

fetchDataFromStatement (line 81)

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

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

boolean getIsLastPage ()

Redefinition of:

TPagedList::getIsLastPage()

getIsMiddlePage (line 201)

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

boolean getIsMiddlePage ()
getIsNextPageAvailable (line 177)

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

boolean getIsNextPageAvailable ()
getIsPreviousPageAvailable (line 185)

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

boolean getIsPreviousPageAvailable ()
getOffsetAndLimit (line 167)

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

Initialize the paged list.

- access: protected

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

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

nextPage (line 94)

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

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

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

- 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 Sun, 30 Sep 2007 19:17:27 -0400 by phpDocumentor 1.3.0RC4