Class data_table

Description

This class builds fundamental figures into a form that is easy to process in templates.

Use the add() method to push in records from the figure_data table. When done, tell the object to process all data by calling render(). Then all data is available for display through the get_* methods.

Located in /plugins/Figures/data_table.class.php (line 43)

data_map
   |
   --data_table
Variable Summary
 array $_class
 array $_data
 array $_datatable
 array $_rowspan
 array $_summary
 array $_years
Method Summary
 void __construct (array $periods)
 void add (object $dao_figure_data)
 void get_class (int $row, [int $col = false])
 array get_columns (int $row)
 int get_num_rows ()
 int get_num_years ()
 void get_periods_existing ([bool $return_keys = false])
 array get_rows ()
 mixed get_rowspan (int $row, int $col)
 array get_summary (int $row, int $col)
 mixed get_value (int $row, int $col)
 array get_years ()
 bool have_summary (int $row, int $col)
 void render ()
 void _add_record (object $dao_figure_data, [string $dest = '_data'])
 void _cycle_css_row ()
 void _update_data (array $var)
Variables
array $_class = array() (line 127)

CSS class information for $_datatable

  • one-or-two-dimensional array: #row, #col
  • contains a string of CSS class names that should be set on a given row and/or cell
  • false means that there shouldn't be any class attribute set

string $_cycle_css_row = 'row1' (line 135)

CSS class string used for rows, altered by _cycle_css_row()

array $_data = array() (line 83)

most recent figures

  • see: get_data()
  • access: protected
array $_datatable = array() (line 101)

the final table created by render()

bool $_input_mode = true (line 57)

mode of operation (input or display)

The add() method is only active in input mode while all the get_* methods are only available in display mode. You must call render() before you can get any data out. A new created object is in input mode.

array $_periods_existing = array() (line 75)

list of periods that exist in the system. Used as {$link $_datatable} header.

  • see: data_table()
  • access: protected
array $_rowspan = array() (line 115)

rowspanning information for $_datatable

  • two-dimensional array: #row, #col
  • a number indicates how many lines a cell should span down
  • a dash ('-') indicates that a cell is covered by another cell that spans above it
  • #row,#col coordinates are not set means the cell is not affected by rowspanning at all

array $_summary = array() (line 93)

less recent figures (all those where a more recent counterpart is

available in $_data)

array $_years = array() (line 66)

list of years for which there are figures available

Inherited Variables

Inherited from data_map

data_map::$_date
data_map::$_id
data_map::$_map
data_map::$_name
data_map::$_period
data_map::$_year
Methods
Constructor __construct (line 142)
  • access: public
void __construct (array $periods)

Redefinition of:
data_map::__construct()
add (line 155)

process figure_data record while in input mode

void add (object $dao_figure_data)
  • object $dao_figure_data
get_class (line 447)

return class information for given row or cell ($row, $col), returns false if there is no such information (the row or cell should not have any class attribute set).

The $col paramenter is optional, if given you ask for a specific cell, if ommited (default) you ask for the entire row.

  • access: public
void get_class (int $row, [int $col = false])
  • int $row
  • int $col
get_columns (line 389)

returns column indices for given $row, use render() first

array get_columns (int $row)
  • int $row
get_num_rows (line 362)

returns number of rows in result table, use render() first

  • access: public
int get_num_rows ()
get_num_years (line 189)

returns the number of years for which we have fundamental figures available

  • access: public
int get_num_years ()
get_periods_existing (line 203)

returns list off all periods that exist in the system

  • see: data_table()
  • access: public
void get_periods_existing ([bool $return_keys = false])
  • bool $return_keys
get_rows (line 375)

returns row indices of result table, use render() first

array get_rows ()
get_rowspan (line 429)

return rowspanning information for given cell ($row,$col), returns false if this cell should not span at all.

mixed get_rowspan (int $row, int $col)
  • int $row
  • int $col
get_summary (line 473)

retrieve less recent fundamental figures by $row/$col

These are those figures that have a more recent counterpart in get_value(). Returns false if there is no such data available.

array get_summary (int $row, int $col)
  • int $row
  • int $col
get_value (line 403)

return value for a cell identified by $row/$col

  • access: public
mixed get_value (int $row, int $col)
  • int $row
  • int $col
get_years (line 177)

returns list off years for which we have fundamental figures available

  • access: public
array get_years ()
have_summary (line 498)

returns true if summary exists for given $row/$col

bool have_summary (int $row, int $col)
  • int $row
  • int $col
render (line 223)

end input mode and render all data ready for displaying

void render ()
_add_record (line 524)

add record to internal $_data or $_summary

void _add_record (object $dao_figure_data, [string $dest = '_data'])
  • object $dao_figure_data
  • string $dest
_cycle_css_row (line 561)

returns cycled CSS class string to be used to rows, usefull when

looping through rows

  • access: protected
void _cycle_css_row ()
_update_data (line 551)

update record in internal $_data array, make sure the old data still kept in summary.

  • todo: not yet implemented
  • access: protected
void _update_data (array $var)
  • array $var

Inherited Methods

Inherited From data_map

 data_map::__construct()
 data_map::get_date()
 data_map::get_id()
 data_map::get_name()
 data_map::get_period()
 data_map::get_uniq_ids()
 data_map::get_year()
 data_map::map_add()

Documentation generated on Sun, 22 Aug 2010 11:20:16 +0200 by phpDocumentor 1.4.3