PHP Class Prado\Collections\TPagedDataSource

TPagedDataSource implements an integer-indexed collection class with paging functionality. Data items in TPagedDataSource can be traversed using foreach PHP statement like the following, foreach($pagedDataSource as $dataItem) The data are fetched from {@link setDataSource DataSource}. Only the items within the specified page will be returned and traversed.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TComponent, implements IteratorAggregate, implements Countable
Datei anzeigen Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
count ( ) : integer Returns the number of items in the current page.
getAllowCustomPaging ( ) : boolean
getAllowPaging ( ) : boolean
getCount ( ) : integer
getCurrentPageIndex ( ) : integer
getDataSource ( ) : mixed
getDataSourceCount ( ) : integer
getFirstIndexInPage ( ) : integer
getIsFirstPage ( ) : boolean
getIsLastPage ( ) : boolean
getIterator ( ) : Iterator
getPageCount ( ) : integer
getPageSize ( ) : integer
getVirtualItemCount ( ) : integer
setAllowCustomPaging ( $value )
setAllowPaging ( $value )
setCurrentPageIndex ( $value )
setDataSource ( $value )
setPageSize ( $value )
setVirtualItemCount ( $value )

Method Details

count() public method

This method is required by \Countable interface.
public count ( ) : integer
return integer number of items in the current page.

getAllowCustomPaging() public method

public getAllowCustomPaging ( ) : boolean
return boolean whether to allow custom paging. Defaults to false.

getAllowPaging() public method

public getAllowPaging ( ) : boolean
return boolean whether to allow paging. Defaults to false.

getCount() public method

public getCount ( ) : integer
return integer number of items in current page

getCurrentPageIndex() public method

public getCurrentPageIndex ( ) : integer
return integer current page index. Defaults to 0.

getDataSource() public method

public getDataSource ( ) : mixed
return mixed original data source. Defaults to null.

getDataSourceCount() public method

public getDataSourceCount ( ) : integer
return integer number of items in data source, if available

getFirstIndexInPage() public method

public getFirstIndexInPage ( ) : integer
return integer the index of the item in data source, where the item is the first in current page

getIsFirstPage() public method

public getIsFirstPage ( ) : boolean
return boolean whether the current page is the first page Defaults to false.

getIsLastPage() public method

public getIsLastPage ( ) : boolean
return boolean whether the current page is the last page

getIterator() public method

public getIterator ( ) : Iterator
return Iterator iterator

getPageCount() public method

public getPageCount ( ) : integer
return integer number of pages

getPageSize() public method

public getPageSize ( ) : integer
return integer number of items in each page. Defaults to 10.

getVirtualItemCount() public method

public getVirtualItemCount ( ) : integer
return integer user-assigned number of items in data source Defaults to 0.

setAllowCustomPaging() public method

public setAllowCustomPaging ( $value )

setAllowPaging() public method

public setAllowPaging ( $value )

setCurrentPageIndex() public method

public setCurrentPageIndex ( $value )

setDataSource() public method

public setDataSource ( $value )

setPageSize() public method

public setPageSize ( $value )

setVirtualItemCount() public method

public setVirtualItemCount ( $value )