tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Paginated_Grid

Source Location: /grids/paginated_grid.class.php

Class Paginated_Grid

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Grid

Grid::$columns_number
Grid::$name
Grid::$rows

Inherited From Grid

Grid::__construct()
Constructor
Grid::add_row()
Adds new row
Grid::get_columns_number()
Returns how many columns grid has
Grid::get_name()
Returns grid name
Grid::get_rows()
Returns reference to rows
Grid::remove_all_rows()
Removes all rows
Grid::remove_row()
Removes a row
Grid::set_columns_number()
Sets how many columns grid will have
Grid::set_name()
Sets grid name
Grid::set_rows()
Sets all rows at once

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
integer   $current_page   Current page
integer   $page_size   Numbur of rows in a page
integer   $total_pages   Count of pages
integer   $total_rows   Total rows in the result set

[ Top ]
Method Summary
Paginated_Grid   __construct()   Constructor
void   calculate_end()   Calculates row end index of the page
integer   calculate_start()   Calculates row start index of the page
integer   calculate_total_pages()   Calculate total pages
unknown   fetch_current_page()   Fetches current page.
array   fetch_first_page()   Fetches first page
array   fetch_last_page()   Fetches last page
array   fetch_next_page()   Fetches next page (next is relative to current page)
array   fetch_page()   Fetches page specified by $page
array   fetch_prev_page()   Fetches previous page
unknown   get_current_page()   Returns current page
integer   get_page_size()   Returns page size
unknown   get_total_pages()   Retursn count of pages
unknown   get_total_rows()   Return count of rows
boolean   is_valid_page()   Checks if page numbers is in existing range of pages
void   refresh()   Recalculates total rows and total pages
void   set_current_page()   Sets current page
void   set_page_size()   Sets page size
void   set_total_pages()   Sets count of pages
void   set_total_rows()   Sets count of rows
array   _fetch_current_page()   Fetches current page.

[ Top ]
Properties
integer   $current_page = 0 [line 33]

Current page

API Tags:
Internal:  
Access:  private


[ Top ]
integer   $page_size [line 47]

Numbur of rows in a page

API Tags:
Access:  private


[ Top ]
integer   $total_pages [line 54]

Count of pages

API Tags:
Access:  private


[ Top ]
integer   $total_rows [line 40]

Total rows in the result set

API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 65]

  Paginated_Grid __construct( string $name, integer $columns_number, [integer $page_size = 20], [integer $forgiving = true]  )

Constructor

Parameters:
string   $name:  Name of grid
integer   $columns_number:  How many coluns will grid have
integer   $page_size:  Size of the page (how many rows)
integer   $forgiving:  Will forgive when not existing page is addressed


Redefinition of:
Grid::__construct()
Constructor

[ Top ]
calculate_end  [line 236]

  void calculate_end( integer $start  )

Calculates row end index of the page

Parameters:
integer   $start: 

API Tags:
Internal:  
Access:  protected


[ Top ]
calculate_start  [line 225]

  integer calculate_start( )

Calculates row start index of the page


API Tags:
Internal:  
Access:  protected


[ Top ]
calculate_total_pages  [line 345]

  integer calculate_total_pages( )

Calculate total pages


API Tags:
Access:  protected


[ Top ]
fetch_current_page  [line 190]

  unknown fetch_current_page( unknown_type $params  )

Fetches current page.

Parameters:
unknown_type   $params: 

API Tags:
Access:  public


[ Top ]
fetch_first_page  [line 251]

  array fetch_first_page( )

Fetches first page


API Tags:
Internal:  
Access:  public


[ Top ]
fetch_last_page  [line 265]

  array fetch_last_page( )

Fetches last page


API Tags:
Internal:  
Access:  public


[ Top ]
fetch_next_page  [line 279]

  array fetch_next_page( )

Fetches next page (next is relative to current page)


API Tags:
Internal:  
Access:  public


[ Top ]
fetch_page  [line 319]

  array fetch_page( integer $page  )

Fetches page specified by $page

Parameters:
integer   $page: 

API Tags:
Access:  public


[ Top ]
fetch_prev_page  [line 299]

  array fetch_prev_page( )

Fetches previous page


API Tags:
Internal:  
Access:  public


[ Top ]
get_current_page  [line 139]

  unknown get_current_page( )

Returns current page


API Tags:
Access:  public


[ Top ]
get_page_size  [line 129]

  integer get_page_size( )

Returns page size


API Tags:
Access:  public


[ Top ]
get_total_pages  [line 179]

  unknown get_total_pages( )

Retursn count of pages


API Tags:
Access:  public


[ Top ]
get_total_rows  [line 159]

  unknown get_total_rows( )

Return count of rows


API Tags:
Access:  public


[ Top ]
is_valid_page  [line 114]

  boolean is_valid_page( integer $page  )

Checks if page numbers is in existing range of pages

Parameters:
integer   $page: 

API Tags:
Internal:  
Access:  private


[ Top ]
refresh  [line 330]

  void refresh( )

Recalculates total rows and total pages


API Tags:
Access:  protected


[ Top ]
set_current_page  [line 89]

  void set_current_page( integer $current_page  )

Sets current page

Parameters:
integer   $current_page: 

API Tags:
Internal:  
Access:  protected


[ Top ]
set_page_size  [line 78]

  void set_page_size( integer $page_size  )

Sets page size

Parameters:
integer   $page_size: 

API Tags:
Internal:  
Access:  protected


[ Top ]
set_total_pages  [line 169]

  void set_total_pages( unknown_type $total_pages  )

Sets count of pages

Parameters:
unknown_type   $total_pages: 

API Tags:
Access:  public


[ Top ]
set_total_rows  [line 149]

  void set_total_rows( unknown_type $total_rows  )

Sets count of rows

Parameters:
unknown_type   $total_rows: 

API Tags:
Access:  public


[ Top ]
_fetch_current_page  [line 205]

  array _fetch_current_page( )

Fetches current page.

The page can be smaller than $this->rows.


API Tags:
Internal:  
Access:  protected


[ Top ]