|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($name, $final_elements=null, $conditionparam=null, $conditionvalue=null) | |
| set_condition ($conditionparam, $conditionvalue) | |
| get_condition_param () | |
| get_condition_value () | |
| condition_matches () | |
| get_level () | |
| process ($processor) | |
| add_add_optigroup ($optigroup) | |
| add_attributes ($attributes) | |
Protected Member Functions | |
| get_new_attribute ($name) | |
| get_new_final_element ($name) | |
| set_parent ($element) | |
Instantiable class representing one optigroup element for conditional branching
Objects of this class are internally nested elements, so they support having both final elements and children (more nested elements) and are able to have one source and all the stuff supported by nested elements. Their main differences are:
Their main use is to allow conditional branching, basically for optional submodules like question types, assignment subtypes... where different subtrees of information must be exported. It's correct to assume that each submodule will define its own optigroup_element for backup purposes.
Definition at line 45 of file backup_optigroup_element.class.php.
| __construct | ( | $ | name, |
| $ | final_elements = null, |
||
| $ | conditionparam = null, |
||
| $ | conditionvalue = null |
||
| ) |
Constructor - instantiates one backup_optigroup_element
| string | $name | of the element |
| array | $final_elements | this element will handle (optional, defaults to null) |
| string | $condition_param | param (path) we are using as source for comparing (optional, defaults to null) |
| string | $condition_value | value we are comparing to (optional, defaults to null) |
Definition at line 59 of file backup_optigroup_element.class.php.

| add_add_optigroup | ( | $ | optigroup | ) |
Adding optigroups is forbidden
Definition at line 156 of file backup_optigroup_element.class.php.
| add_attributes | ( | $ | attributes | ) |
Adding attributes is forbidden
Reimplemented from base_final_element.
Definition at line 163 of file backup_optigroup_element.class.php.
Evaluate the condition, returning if matches (true) or no (false)
Definition at line 90 of file backup_optigroup_element.class.php.
Definition at line 79 of file backup_optigroup_element.class.php.
Definition at line 83 of file backup_optigroup_element.class.php.
| get_level | ( | ) |
Return the level of this element, that will be, the level of the parent (doesn't consume level) (note this os only a "cosmetic" effect (to_string) as fact as the real responsible for this is the corresponding structure_processor for the final output.
Reimplemented from base_final_element.
Definition at line 106 of file backup_optigroup_element.class.php.

| get_new_attribute | ( | $ | name | ) | [protected] |
Instantiating attributes is forbidden
Reimplemented from backup_nested_element.
Definition at line 170 of file backup_optigroup_element.class.php.
| get_new_final_element | ( | $ | name | ) | [protected] |
Returns one instace of the class to work with when final_elements are added simply by name
Reimplemented from backup_nested_element.
Definition at line 180 of file backup_optigroup_element.class.php.
| process | ( | $ | processor | ) |
process one optigroup_element
Note that this ONLY processes the final elements in order to get all them before processing any nested element. Pending nested elements are processed by the optigroup caller.
Reimplemented from backup_nested_element.
Definition at line 117 of file backup_optigroup_element.class.php.

| set_condition | ( | $ | conditionparam, |
| $ | conditionvalue | ||
| ) |
Sets the condition for this optigroup
Definition at line 69 of file backup_optigroup_element.class.php.


| set_parent | ( | $ | element | ) | [protected] |
Set the parent of the optigroup_element and, at the same time, process the condition param
Reimplemented from base_final_element.
Definition at line 188 of file backup_optigroup_element.class.php.
