Moodle  2.2.1
http://www.collinsharper.com
backup_optigroup_element Class Reference
Inheritance diagram for backup_optigroup_element:
Collaboration diagram for backup_optigroup_element:

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)

Detailed Description

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:

  • Support for conditional execution, using simple equality checks with outer values.
  • Don't have representation in the hierarchy, so:
    • Their level is the level of the parent of their enclosing optigroup.
    • Act as one "path bridge" when looking for parent path values
    • They don't support attributes

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.


Constructor & Destructor Documentation

__construct ( name,
final_elements = null,
conditionparam = null,
conditionvalue = null 
)

Constructor - instantiates one backup_optigroup_element

Parameters:
string$nameof the element
array$final_elementsthis element will handle (optional, defaults to null)
string$condition_paramparam (path) we are using as source for comparing (optional, defaults to null)
string$condition_valuevalue we are comparing to (optional, defaults to null)

Definition at line 59 of file backup_optigroup_element.class.php.

Here is the call graph for this function:


Member Function Documentation

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.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

set_condition ( conditionparam,
conditionvalue 
)

Sets the condition for this optigroup

Definition at line 69 of file backup_optigroup_element.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations