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 46 of file PagingInfo.php.

getTotalCount ( )

Get the number of list items.

Returns
Number

Definition at line 54 of file PagingInfo.php.

setPage (   $page)

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

Parameters
$pageThe current page.

Definition at line 62 of file PagingInfo.php.

getPage ( )

Get the current page (1-based).

Returns
Number

Definition at line 71 of file PagingInfo.php.

getPageSize ( )

Get the size of a pages.

Returns
Number

Definition at line 79 of file PagingInfo.php.

getPageCount ( )

Get the number of pages.

Returns
Number

Definition at line 87 of file PagingInfo.php.

setOffset (   $offset)

Set the current offset (also selects the page).

Parameters
$offsetThe current list offset.

Definition at line 95 of file PagingInfo.php.

getOffset ( )

Get the current offset.

Returns
Number

Definition at line 104 of file PagingInfo.php.

isOnFirstPage ( )

Determine if we are on the first page.

Returns
Boolean

Definition at line 112 of file PagingInfo.php.

isOnLastPage ( )

Determine if we are on the first page.

Returns
Boolean

Definition at line 120 of file PagingInfo.php.

isIgnoringTotalCount ( )

Check if this instance iignores the total count.

Returns
Boolean

Definition at line 128 of file PagingInfo.php.