|
Squiz Matrix
4.12.2
|
Public Member Functions | |
| Conditions_List (&$host_asset, $conditions_attribute_name='') | |
| setHost (&$host_asset, $conditions_attribute_name) | |
| evaluate (&$asset_being_painted, $condition_names, &$logical_keywords, $boolean_values=Array(0, 1)) | |
| _updateKeywordsInRestriction (&$logical_keywords, &$condition_parameters) | |
| getConditionsNames () | |
| getRequiredKeywords ($condition_name) | |
| _getConditionRestriction ($condition_name) | |
| & | _getConditionAsset ($condition_type, $edit_fns=FALSE) |
| _getConditionParameter ($condition_name, $key='', $default=Array()) | |
| _getAllConditions () | |
| & | _getHostAsset () |
| & | _getCurrentUser () |
| isValid () | |
| paintConditionsList (&$asset, &$o, $prefix, $write_access, $allowed_keywords) | |
| processConditionsList (&$asset, &$o, $prefix, $write_access, $allowed_keywords) | |
| _generateUniqueName ($desired_name, &$reserved_names) | |
Data Fields | |
| $host_asset = NULL | |
| $conditions_attribute_name = '' | |
Definition at line 37 of file conditions_list.inc.
| _generateUniqueName | ( | $desired_name, | |
| & | $reserved_names | ||
| ) |
Returns a unique name based on a desired name and not part of an array of a existing names
| string | $desired_name | desired new name |
| array | &$reserved_names | array of reserved name |
Definition at line 514 of file conditions_list.inc.
| _getAllConditions | ( | ) |
Returns all the conditions parameters in one array
Definition at line 285 of file conditions_list.inc.
| & _getConditionAsset | ( | $condition_type, | |
$edit_fns = FALSE |
|||
| ) |
Returns a reference to a child Condition Asset, or its edit functions
| string | $condition_type | a condition type code |
| boolean | $edit_fns | if TRUE returns an instance of the edit_fns class |
Definition at line 233 of file conditions_list.inc.
| _getConditionParameter | ( | $condition_name, | |
$key = '', |
|||
$default = Array() |
|||
| ) |
Returns parameters of a condition.
If a key is given, it will return the corresponding element in the parameters, otherwise the whole array is returned. If the desired value doesn't exists the default value is returned.
| string | $condition_name | condition name |
| string | $key | optional element in the parameters |
| mixed | $default | default value to return if the result is empty |
Definition at line 261 of file conditions_list.inc.
| _getConditionRestriction | ( | $condition_name | ) |
Returns the condition data array for a particular condition
| string | $condition_name | a condition name |
Definition at line 217 of file conditions_list.inc.
| & _getCurrentUser | ( | ) |
Get a reference to the current user asset.
Definition at line 316 of file conditions_list.inc.
| & _getHostAsset | ( | ) |
Returns a reference to the host asset
Definition at line 303 of file conditions_list.inc.
| _updateKeywordsInRestriction | ( | & | $logical_keywords, |
| & | $condition_parameters | ||
| ) |
Set the values of the conditional keywords in the condition parameters
The call_user_func_array() is messy but we need it to be able to statically call the same function in a variable type code (which is not as easy with static calls as it is creating objects of a variable type code). Could not use plain call_user_func() either because of the need to pass by reference
| array | &$logical_keywords | logical keywords (keyword => value) |
| array | &$condition_parameters | condition parameters |
Definition at line 155 of file conditions_list.inc.
| Conditions_List | ( | & | $host_asset, |
$conditions_attribute_name = '' |
|||
| ) |
| evaluate | ( | & | $asset_being_painted, |
| $condition_names, | |||
| & | $logical_keywords, | ||
$boolean_values = Array(0, 1) |
|||
| ) |
Evaluates multiple conditions
Returns an array of (condition_name => condition_value)
| object | $asset_being_painted | The asset being painted, relevant when evaluating conditions |
| array | $condition_names | Conditions to evaluate |
| array | &$logical_keywords | Logical keywords and their values (keyword => value) |
| array | $boolean_values | Values to assign to the returned array for TRUE or FALSE |
Definition at line 111 of file conditions_list.inc.
| getConditionsNames | ( | ) |
Returns an array of condition names
Definition at line 171 of file conditions_list.inc.
| getRequiredKeywords | ( | $condition_name | ) |
Returns the list of keywords required by a condition
The call_user_func() is messy but we need it to be able to statically call the same function in a variable type code (which is not as easy with static calls as it is creating objects of a variable type code).
| string | $condition_name | condition name |
Definition at line 192 of file conditions_list.inc.
| isValid | ( | ) |
Returns TRUE if this object has a proper host asset and a attribute name for the condition parameters
Definition at line 332 of file conditions_list.inc.
| paintConditionsList | ( | & | $asset, |
| & | $o, | ||
| $prefix, | |||
| $write_access, | |||
| $allowed_keywords | |||
| ) |
Paint the backend editing interface for the conditions list
| object | &$asset | the asset we are painting for |
| object | &$o | the backend outputter class |
| string | $prefix | prefix for form elements |
| boolean | $write_access | do we have write access to this? |
| array | $allowed_keywords | allowed keywords |
Definition at line 354 of file conditions_list.inc.
| processConditionsList | ( | & | $asset, |
| & | $o, | ||
| $prefix, | |||
| $write_access, | |||
| $allowed_keywords | |||
| ) |
Process the backend editing interface for the conditions list
| object | &$asset | the asset we are painting for |
| object | &$o | the backend outputter class |
| string | $prefix | prefix for form elements |
| boolean | $write_access | do we have write access to this? |
| array | $allowed_keywords | allowed keywords |
Definition at line 453 of file conditions_list.inc.
| setHost | ( | & | $host_asset, |
| $conditions_attribute_name | |||
| ) |
Initialises the condition list with a host
| object | &$host_asset | the host asset for this condition list |
| string | $conditions_attribute_name | attribute containing the conditions |
Definition at line 88 of file conditions_list.inc.