CorePlugins

# Class: GroupRule Source Location: /coreplugins/tables/common/TableRulesRegistry.php
### Class Overview
    BaseRule
       |
       --GroupRule
Base rule for rules that will be applied on groups of tables #### Author(s): | ### Variables $groupId | ### Constants WEIGHT_GROUP_GLOBAL WEIGHT_GROUP_PARTIAL WEIGHT_GROUP_SINGLE | ### Methods addWeight applyRule applyRules checkRule getWeight
### Child classes: TableRule Base rule for rules that will be applied on tables GroupFilter Rule to modify group title | ### Inherited Constants #### Class: BaseRule BaseRule::WEIGHT_NO_MATCH | ### Inherited Variables #### Class: BaseRule BaseRule::$log | ### Inherited Methods #### Class: BaseRule BaseRule::__construct() Constructor
### Class Details [line 93] Base rule for rules that will be applied on groups of tables #### Tags:
abstract: |
[ Top ] ### Class Variables #### $groupId = [line 102] #### Tags:
access: | public
Type: | string
[ Top ] ### Class Methods ### method addWeight [line 149]
`void addWeight( int $weight, array &$weights)`
Stores computed weights The array which contains weights has the following structure:
     Array ([0] => Array (['rule'] => Object (),
                          ['weights'] => Array (['param1'] => weight1,
                                                ['param2'] => weight2) ),
            [1] => Array (['rule'] => Object (),
                          ['weights'] => Array (['param3'] => weight3,
                                                ['param4'] => weight4) ) )
For most rules, there is only one element in the array and only one rule and weight defined. See ColumnAdder for an example of a more complicated rule. #### Tags:
access: | protected
Overridden in child classes as: ColumnAdder::addWeight() Stores computed weights #### Parameters:
int | $weight |
array | &$weights |
[ Top ] ### method applyRule [line 184]
`void applyRule( TableGroup $group, array $params)`
Executes a rule on a group Parameters are taken from the weights structure. #### Tags:
access: | public
see: | GroupRule::addWeight()
Overridden in child classes as: TableRule::applyRule() Executes a rule on a table ColumnRule::applyRule() Executes a rule on a column CellFilter::applyRule() Execute a rule on cells of a column CellFilterBatch::applyRule() Execute a rule on cells of a column ColumnFilter::applyRule() Execute a rule on a column ColumnSelector::applyRule() Executes a rule on a table ColumnUnselector::applyRule() Executes a rule on a table TableFilter::applyRule() Execute a rule on a table ColumnAdder::applyRule() Execute a rule on table ColumnAdderBatch::applyRule() Execute a rule on table RowUnselector::applyRule() Execute a rule on each rows of a table RowSelector::applyRule() Executes a rule on every rows of a table ColumnReorder::applyRule() Executes a rule on a table GroupFilter::applyRule() Execute a rule on a group #### Parameters:
TableGroup | $group |
array | $params |
[ Top ] ### method applyRules [line 191]
`void applyRules( array $rules, TableGroup $group)`
Applies a set of rules on a group #### Tags:
access: | public
static: |
Overridden in child classes as: TableRule::applyRules() Applies a set of rules on a table ColumnRule::applyRules() Applies a set of rules on a column #### Parameters:
array | $rules | array of GroupRule
TableGroup | $group |
[ Top ] ### method checkRule [line 166]
`void checkRule( string $groupId, array &$weights)`
Checks a rule #### Tags:
access: | protected
Overridden in child classes as: TableRule::checkRule() Checks a rule ColumnRule::checkRule() Checks a rule #### Parameters:
string | $groupId |
array | &$weights |
[ Top ] ### method getWeight [line 117]
`int getWeight( string $groupId)`
Computes weight Weight is used to decide which rule will be executed. Group rules can be defined with following parameters: '*': rule applies on all groups 'foo*': rule applies on groups with id starting with 'foo' 'bar': rule applies on group with id = 'bar' #### Tags:
access: | protected
Overridden in child classes as: TableRule::getWeight() Computes weight ColumnRule::getWeight() Computes weight #### Parameters:
string | $groupId |
[ Top ] ### Class Constants #### WEIGHT_GROUP_GLOBAL = 64 [line 97] [ Top ] #### WEIGHT_GROUP_PARTIAL = 128 [line 96] [ Top ] #### WEIGHT_GROUP_SINGLE = 256 [line 95] [ Top ] Documentation generated on Fri, 21 Sep 2007 13:31:09 +0200 by phpDocumentor 1.3.0RC3