CorePlugins
[ class tree: CorePlugins ] [ index: CorePlugins ] [ all elements ]

Class: ColumnAdder

Source Location: /coreplugins/tables/common/TableRulesRegistry.php

Class Overview

BaseRule
   |
   --GroupRule
      |
      --TableRule
         |
         --TableFilter
            |
            --ColumnAdder

Rule to add one or more columns and compute content of cells one by one


Author(s):

Variables

Methods


Child classes:

ColumnAdderBatch
Rule to add one or more columns and compute content of all cells

Inherited Constants

Inherited Variables

Inherited Methods

Class: TableFilter

TableFilter::__construct()
Constructor
TableFilter::applyRule()
Execute a rule on a table

Class: TableRule

TableRule::applyRule()
Executes a rule on a table
TableRule::applyRules()
Applies a set of rules on a table
TableRule::checkRule()
Checks a rule
TableRule::getIndexes()
Returns a map of index id's to their offset in the columnIds array.
TableRule::getWeight()
Computes weight

Class: GroupRule

GroupRule::addWeight()
Stores computed weights
GroupRule::applyRule()
Executes a rule on a group
GroupRule::applyRules()
Applies a set of rules on a group
GroupRule::checkRule()
Checks a rule
GroupRule::getWeight()
Computes weight

Class: BaseRule

BaseRule::__construct()
Constructor

Class Details

[line 842]
Rule to add one or more columns and compute content of cells one by one

Callback method should have the following signature:

 static function myCallbackMethod('table_id',
                                  array ('column_1' => 'value_1',
                                         'column_2' => 'value_2'))
   return array ('new_column_1' => 'cell_value_1',
                 'new_column_2' => 'cell_value_2')




Tags:

see:  CellFilter


[ Top ]


Class Variables

$columnPosition =

[line 847]



Tags:

access:  public

Type:   ColumnPosition


[ Top ]

$inputColumnIds =

[line 857]



Tags:

access:  public

Type:   array


[ Top ]

$newColumnIds =

[line 852]



Tags:

access:  public

Type:   array


[ Top ]



Class Methods


constructor __construct [line 868]

ColumnAdder __construct( string $groupId, string $tableId, ColumnPosition $columnPosition, array $newColumnIds, array $inputColumnIds, array $callback)

Constructor



Tags:

access:  public


Overrides TableFilter::__construct() (Constructor)

Parameters:

string   $groupId  
string   $tableId  
ColumnPosition   $columnPosition  
array   $newColumnIds  
array   $inputColumnIds  
array   $callback  

[ Top ]

method addNewColumns [line 881]

void addNewColumns( Table $table, array $columnIds)

Adds new columns into table definition of columns



Tags:

access:  protected


Parameters:

Table   $table  
array   $columnIds  

[ Top ]

method addWeight [line 982]

void addWeight( int $weight, array &$weights)

Stores computed weights

Weights are stored in an array which has the structure described in TableRule::addWeight().

When a rule with a greater weight is found, column Id is removed from old rule and added to current rule. With standard rules, only one rule is executed for each type of rule. ColumnAdder rule can be executed several times, but only once with the same column Id.




Tags:

access:  protected


Overrides GroupRule::addWeight() (Stores computed weights)

Parameters:

int   $weight  
array   &$weights  

[ Top ]

method applyRule [line 934]

void applyRule( Table $table, array $params)

Execute a rule on table



Tags:

access:  public


Overridden in child classes as:

ColumnAdderBatch::applyRule()
Execute a rule on table

Overrides TableFilter::applyRule() (Execute a rule on a table)

Parameters:

Table   $table  
array   $params  

[ Top ]


Documentation generated on Wed, 6 Apr 2005 12:07:02 +0200 by phpDocumentor 1.3.0RC3