PagingInfo Class Reference

Detailed Description

PagingInfo contains information about a paged list.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 18 of file PagingInfo.php.

Public Member Functions

 __construct ($pageSize, $ignoreTotalCount=false)
 
 setTotalCount ($totalCount)
 
 getTotalCount ()
 
 setPage ($page)
 
 getPage ()
 
 getPageSize ()
 
 getPageCount ()
 
 setOffset ($offset)
 
 getOffset ()
 
 isOnFirstPage ()
 
 isOnLastPage ()
 
 isIgnoringTotalCount ()
 

Constructor & Destructor Documentation

__construct (   $pageSize,
  $ignoreTotalCount = false 
)

Creates a PagingInfo object.

The ignoreTotalCount parameter may be set to true, if the count is to be ignored. This may speed up loading of objects, because an extra count query may be omitted.

Parameters
$pageSizeThe pageSize (-1 to set no page size)
$ignoreTotalCountBoolean whether this instance ignores the total count or not (optional, default: false)

Definition at line 34 of file PagingInfo.php.

Member Function Documentation

setTotalCount (   $totalCount)

Set the number of list items.

Parameters
$totalCountThe number of list items.

Definition at line 43 of file PagingInfo.php.

getTotalCount ( )

Get the number of list items.

Returns
Number

Definition at line 51 of file PagingInfo.php.

setPage (   $page)

Set the current page (1-based) (also sets the offset).

Parameters
$pageThe current page.

Definition at line 59 of file PagingInfo.php.

getPage ( )

Get the current page (1-based).

Returns
Number

Definition at line 68 of file PagingInfo.php.

getPageSize ( )

Get the size of a pages.

Returns
Number

Definition at line 76 of file PagingInfo.php.

getPageCount ( )

Get the number of pages.

Returns
Number

Definition at line 84 of file PagingInfo.php.

setOffset (   $offset)

Set the current offset (also selects the page).

Parameters
$offsetThe current list offset.

Definition at line 92 of file PagingInfo.php.

getOffset ( )

Get the current offset.

Returns
Number

Definition at line 101 of file PagingInfo.php.

isOnFirstPage ( )

Determine if we are on the first page.

Returns
Boolean

Definition at line 109 of file PagingInfo.php.

isOnLastPage ( )

Determine if we are on the first page.

Returns
Boolean

Definition at line 117 of file PagingInfo.php.

isIgnoringTotalCount ( )

Check if this instance iignores the total count.

Returns
Boolean

Definition at line 125 of file PagingInfo.php.