Class DataPagination

Description

Data pagination object holds data that calculate per page output (start, end, number of pages, first and last page etc)

  • version: 1.0

Located in /environment/classes/dataaccess/DataPagination.class.php (line 10)


	
			
Method Summary
DataPagination __construct ([integer $total_items = null], [integer $items_per_page = null], [integer $current_page = null])
integer countItemsOnPage (integer $page)
integer getCurrentPage (null 0)
integer getItemsPerPage (null 0)
integer getLimitStart ([integer $page = null])
integer getNext (void 0)
integer getPrevious (void 0)
integer getTotalItems (null 0)
integer getTotalPages (void 0)
boolean hasNext ([integer $page = null])
boolean hasPrevious ([integer $page = null])
boolean isCurrent ([integer $page = null])
boolean isFirst ([integer $page = null])
boolean isLast ([integer $page = null])
null setCurrentPage (integer $value)
null setItemsPerPage (integer $value)
null setTotalItems (integer $value)
Methods
Constructor __construct (line 50)

Construct the DataPagination

  • access: public
DataPagination __construct ([integer $total_items = null], [integer $items_per_page = null], [integer $current_page = null])
  • integer $total_items: Number of items
  • integer $items_per_page: Number of items per page. Default is 10
  • integer $current_page: Current page. Default is 1
countItemsOnPage (line 182)

Return number of items on specific page

integer countItemsOnPage (integer $page)
  • integer $page
getCurrentPage (line 266)

Get current_page

  • access: public
integer getCurrentPage (null 0)
  • null 0
getItemsPerPage (line 243)

Get items_per_page

  • access: public
integer getItemsPerPage (null 0)
  • null 0
getLimitStart (line 200)

Return first param for LIMIT in queries. Second one is number of items per page

  • access: public
integer getLimitStart ([integer $page = null])
  • integer $page: On witch page? If null current will be used
getNext (line 137)

Return next page number. In case of an error this function will return current page number. Check if next page exists using hasNext() function

  • access: public
integer getNext (void 0)
  • void 0
getPrevious (line 111)

Return previous page. If there is some kind of error function will return current page. Check existance of prev page using hasPrevious() function

  • access: public
integer getPrevious (void 0)
  • void 0
getTotalItems (line 220)

Get total_items

  • access: public
integer getTotalItems (null 0)
  • null 0
getTotalPages (line 163)

Return total number of pages

  • access: public
integer getTotalPages (void 0)
  • void 0
hasNext (line 150)

Check if specific page has next page. If $page is null function will use current page

  • access: public
boolean hasNext ([integer $page = null])
  • integer $page: Page that need to be checked. If null function will use current page
hasPrevious (line 124)

Check if specific page has previous page. If $page is null function will use current page

  • access: public
boolean hasPrevious ([integer $page = null])
  • integer $page: Page that need to be checked. If null function will use current page
isCurrent (line 69)

Check if specific page is current page. If $page is null function will use current page

  • access: public
boolean isCurrent ([integer $page = null])
  • integer $page: Page that need to be checked. If null function will use current page
isFirst (line 83)

Check if specific page is first page. If $page is null function will use current page

  • access: public
boolean isFirst ([integer $page = null])
  • integer $page: Page that need to be checked. If null function will use current page
isLast (line 97)

Check if specific page is last page. If $page is null function will use current page

  • access: public
boolean isLast ([integer $page = null])
  • integer $page: Page that need to be checked. If null function will use current page
setCurrentPage (line 277)

Set current_page value

  • access: public
null setCurrentPage (integer $value)
  • integer $value
setItemsPerPage (line 254)

Set items_per_page value

  • access: public
null setItemsPerPage (integer $value)
  • integer $value
setTotalItems (line 231)

Set total_items value

  • access: public
null setTotalItems (integer $value)
  • integer $value

Documentation generated on Wed, 23 Jan 2008 01:58:33 +0000 by phpDocumentor 1.4.0