TPagedDataSource class
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
DataSource. Only the items within the specified page will be returned and traversed.
| Method Details |
count
Returns the number of items in the current page.
This method is required by Countable interface.
| Output |
|
integer
| number of items in the current page. |
| Exception |
|
getAllowCustomPaging
| public boolean getAllowCustomPaging |
() |
| Output |
|
boolean
| whether to allow custom paging. Defaults to false. |
| Exception |
|
getAllowPaging
| public boolean getAllowPaging |
() |
| Output |
|
boolean
| whether to allow paging. Defaults to false. |
| Exception |
|
getCount
| public integer getCount |
() |
| Output |
|
integer
| number of items in current page |
| Exception |
|
getCurrentPageIndex
| public integer getCurrentPageIndex |
() |
| Output |
|
integer
| current page index. Defaults to 0. |
| Exception |
|
getDataSource
| public mixed getDataSource |
() |
| Output |
|
mixed
| original data source. Defaults to null. |
| Exception |
|
getDataSourceCount
| public integer getDataSourceCount |
() |
| Output |
|
integer
| number of items in data source, if available |
| Exception |
|
getFirstIndexInPage
| public integer getFirstIndexInPage |
() |
| Output |
|
integer
| the index of the item in data source, where the item is the first in current page |
| Exception |
|
getIsFirstPage
| public boolean getIsFirstPage |
() |
| Output |
|
boolean
| whether the current page is the first page Defaults to false. |
| Exception |
|
getIsLastPage
| public boolean getIsLastPage |
() |
| Output |
|
boolean
| whether the current page is the last page |
| Exception |
|
getIterator
| public Iterator getIterator |
() |
| Output |
|
Iterator
| iterator |
| Exception |
|
getPageCount
| public integer getPageCount |
() |
| Output |
|
integer
| number of pages |
| Exception |
|
getPageSize
| public integer getPageSize |
() |
| Output |
|
integer
| number of items in each page. Defaults to 10. |
| Exception |
|
getVirtualItemCount
| public integer getVirtualItemCount |
() |
| Output |
|
integer
| user-assigned number of items in data source Defaults to 0. |
| Exception |
|
setAllowCustomPaging
| public void setAllowCustomPaging |
(boolean $value ) |
| Input |
| boolean | $value | whether to allow custom paging |
| Output |
| Exception |
|
setAllowPaging
| public void setAllowPaging |
(boolean $value ) |
| Input |
| boolean | $value | whether to allow paging |
| Output |
| Exception |
|
setCurrentPageIndex
| public void setCurrentPageIndex |
(integer $value ) |
| Input |
| integer | $value | current page index |
| Output |
| Exception |
|
setDataSource
| public void setDataSource |
(mixed $value ) |
| Input |
| mixed | $value | original data source |
| Output |
| Exception |
|
setPageSize
| public void setPageSize |
(integer $value ) |
| Input |
| integer | $value | number of items in each page |
| Output |
| Exception |
|
setVirtualItemCount
| public void setVirtualItemCount |
(integer $value ) |
| Input |
| integer | $value | user-assigned number of items in data source |
| Output |
| Exception |
|