spunQ_QueryPager Class Reference

A query pager that does all the boilerplate stuff. More...

Inheritance diagram for spunQ_QueryPager:

List of all members.

Public Member Functions

 __construct (spunQ_SelectQuery $query=NULL, $itemsPerPage=NULL, $currentPage=NULL)
 Constructor.
 getPageContents ()
 Returns the results to show on the current page.
 getAmountPages ()
 Returns the total number of pages.
 getAmountObjects ()
 Returns the total number of objects the query would return.
 setAmountObjects ($amount)
 Sets the total number of objects the query would return.
 getQueryParameters ()
 setQueryParameters ($queryParameters)
 getObjects ()
 Returns the objects in the pager.
 getItemsPerPage ()
 getCurrentPage ()
 setCurrentPage ($currentPage)
 Setter needed to set currentPage.
 show ($entryPoint, $entryPointParameters, $pageParameter= 'page', $proximity=3, $template= 'spunQ.querypager.default')
 showAjax ($entryPoint, $entryPointParameters, $divToUpdate, $ajaxPostValues= '', $pageParameter= 'page', $proximity=3, $template= 'spunQ.querypager.ajax')

Protected Attributes

 $query
 The query we're paging.
 $db = 'default'
 Database to run query on.
 $queryParameters = array()
 $objects
 The objects we're paging.
 $itemsPerPage
 Number of items per page.
 $currentPage = 1
 The page we're currently displaying.
 $amountPages = NULL
 Caches getAmountPages().
 $amountObjects = NULL
 Caches getAmountObjects().


Detailed Description

A query pager that does all the boilerplate stuff.

Definition at line 6 of file QueryPager.class.php.


Constructor & Destructor Documentation

spunQ_QueryPager::__construct ( spunQ_SelectQuery query = NULL,
itemsPerPage = NULL,
currentPage = NULL 
)

Constructor.

Parameters:
$query The query we're paging.
$itemsPerPage Number of items to show per page.
$currentPage Current page number.

Definition at line 31 of file QueryPager.class.php.


Member Function Documentation

spunQ_QueryPager::getAmountObjects (  ) 

Returns the total number of objects the query would return.

Returns:
integer

Definition at line 64 of file QueryPager.class.php.

spunQ_QueryPager::getAmountPages (  ) 

Returns the total number of pages.

Returns:
integer

Definition at line 52 of file QueryPager.class.php.

spunQ_ObjectPager::getObjects (  )  [inherited]

Returns the objects in the pager.

Returns:
array<any>

Definition at line 52 of file ObjectPager.class.php.

spunQ_QueryPager::getPageContents (  ) 

Returns the results to show on the current page.

Returns:
array<spunQ.db.StorableObject>

Definition at line 42 of file QueryPager.class.php.

spunQ_QueryPager::setAmountObjects ( amount  ) 

Sets the total number of objects the query would return.

This is an optimization, the function does not need to be called at all. But if the number is available, it can be passed to this function to make one less query.

Parameters:
amount integer
Returns:
QueryPager $this

Definition at line 79 of file QueryPager.class.php.

spunQ_ObjectPager::setCurrentPage ( currentPage  )  [inherited]

Setter needed to set currentPage.

when check if Page still exists after deletion fails

Definition at line 94 of file ObjectPager.class.php.


Member Data Documentation

spunQ_ObjectPager::$amountObjects = NULL [protected, inherited]

Caches getAmountObjects().

Type:
integer

Definition at line 33 of file ObjectPager.class.php.

spunQ_ObjectPager::$amountPages = NULL [protected, inherited]

Caches getAmountPages().

Type:
integer

Definition at line 27 of file ObjectPager.class.php.

spunQ_ObjectPager::$currentPage = 1 [protected, inherited]

The page we're currently displaying.

Type:
integer

Definition at line 21 of file ObjectPager.class.php.

spunQ_QueryPager::$db = 'default' [protected]

Database to run query on.

Type:
string

Definition at line 18 of file QueryPager.class.php.

spunQ_ObjectPager::$itemsPerPage [protected, inherited]

Number of items per page.

Type:
integer

Definition at line 15 of file ObjectPager.class.php.

spunQ_ObjectPager::$objects [protected, inherited]

The objects we're paging.

Type:
array<spunQ.db.StorableObject>

Definition at line 9 of file ObjectPager.class.php.

spunQ_QueryPager::$query [protected]

The query we're paging.

Type:
spunQ.db.SelectQuery

Definition at line 12 of file QueryPager.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:43 2011 for spunQ3 by  doxygen 1.5.9