PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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.

TComponent
Extended by TList implements IteratorAggregate, ArrayAccess, Countable
Extended by TPagedList
Extended by TSqlMapPagedList
Package: System\Data\SqlMap
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>
Since: 3.1
Located at Data/SqlMap/DataMapper/TSqlMapPagedList.php
Methods summary
public
# __construct( IMappedStatement $statement, mixed $parameter, integer $pageSize, mixed $delegate = null, integer $page = 0 )

Create a new SqlMap paged list.

Create a new SqlMap paged list.

Parameters

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

Throws

TInvalidDataTypeException
If data is not null and neither an array nor an iterator.

Overrides

TPagedList::__construct()
protected
# initialize( IMappedStatement $statement, mixed $parameter, integer $pageSize, integer $page )

Initialize the paged list.

Initialize the paged list.

Parameters

$statement
IMappedStatement
SqlMap statement.
$parameter
mixed
query parameters
$pageSize
integer
page size.
$page
integer
number of page.
public
# setCustomPaging( boolean $value )

Parameters

$value
boolean
whether to allow custom paging

Throws

TSqlMapException
custom paging must be enabled.

Overrides

TPagedList::setCustomPaging()
protected
# fetchDataFromStatement( TPageList $sender, TPagedListFetchDataEventParameter $param )

Fetch data by executing the SqlMap statement.

Fetch data by executing the SqlMap statement.

Parameters

$sender
TPageList
current object.
$param
TPagedListFetchDataEventParameter
fetch parameters
public integer|boolean
# nextPage( )

Switches to the next page.

Switches to the next page.

Returns

integer|boolean
the new page index, false if next page is not availabe.

Overrides

TPagedList::nextPage()
public integer|boolean
# previousPage( )

Switches to the previous page.

Switches to the previous page.

Returns

integer|boolean
the new page index, false if previous page is not availabe.

Overrides

TPagedList::previousPage()
protected
# populateData( TPagedListFetchDataEventParameter $param, array $data )

Populate the list with the fetched data.

Populate the list with the fetched data.

Parameters

$param
TPagedListFetchDataEventParameter
fetch parameters
$data
array
fetched data.
protected array
# getOffsetAndLimit( TPagedListFetchDataEventParameter $param )

Calculate the data fetch offsets and limits.

Calculate the data fetch offsets and limits.

Parameters

$param
TPagedListFetchDataEventParameter
fetch parameters

Returns

array
1st element is the offset, 2nd element is the limit.
public boolean
# getIsNextPageAvailable( )

Returns

boolean
true if the next page is available, false otherwise.
public boolean
# getIsPreviousPageAvailable( )

Returns

boolean
true if the previous page is available, false otherwise.
public boolean
# getIsLastPage( )

Returns

boolean
true if is the very last page, false otherwise.

Overrides

TPagedList::getIsLastPage()
public boolean
# getIsMiddlePage( )

Returns

boolean
true if is not first nor last page, false otherwise.
Methods inherited from TPagedList
getCount(), getCurrentPageIndex(), getCustomPaging(), getIsFirstPage(), getIterator(), getPageCount(), getPageSize(), getVirtualCount(), gotoPage(), indexOf(), itemAt(), offsetExists(), offsetGet(), onFetchData(), onPageIndexChanged(), setCurrentPageIndex(), setPageSize(), setVirtualCount(), toArray()
Methods inherited from TList
add(), clear(), contains(), copyFrom(), count(), getReadOnly(), insertAfter(), insertAt(), insertBefore(), mergeWith(), offsetSet(), offsetUnset(), remove(), removeAt(), setReadOnly()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO