Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
backup_optigroup Class Reference

Instantiable class representing one optigroup element for conditional branching. More...

Inheritance diagram for backup_optigroup:
base_optigroup processable base_nested_element base_final_element base_atom

Public Member Functions

 add_attributes ($attributes)
 Adding attributes is forbidden.
 
 add_child ($element)
 
 add_final_elements ($attributes)
 Adding final elements is forbidden.
 
 add_optigroup ($optigroup)
 
 clean_value ()
 
 clean_values ()
 
 destroy ()
 Destroy all circular references.
 
 get_attribute ($name)
 
 get_attributes ()
 Public API starts here.
 
 get_child ($name)
 
 get_children ()
 
 get_final_element ($name)
 
 get_final_elements ()
 Public API starts here.
 
 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.
 
 get_name ()
 Public API starts here.
 
 get_optigroup ()
 
 get_parent ()
 
 get_value ()
 
 is_set ()
 
 process ($processor)
 This function will call to the corresponding processor method in other to make them perform the desired tasks.
 
 set_value ($value)
 
 to_string ($showvalue=false)
 

Protected Member Functions

 add_children ($elements)
 
 add_used ($element)
 Recalculate all the used elements in the optigroup, observing restrictions and passing the new used to outer level.
 
 check_and_set_used ($element)
 
 find_element_by_path ($path)
 
 find_first_parent_by_name ($name)
 
 get_grandoptigroupelement_or_grandparent ()
 
 get_grandparent ()
 
 get_new_attribute ($name)
 Instantiating attributes is forbidden.
 
 get_new_final_element ($name)
 Instantiating final elements is forbidden.
 
 get_used ()
 
 is_multiple ()
 
 set_parent ($element)
 Set the parent of the optigroup and, at the same time, process all the condition params in all the childs.
 
 set_used ($used)
 
 validate_name ($name)
 

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.

Member Function Documentation

◆ add_attributes()

base_optigroup::add_attributes ( $attributes)
inherited

Adding attributes is forbidden.

Reimplemented from base_final_element.

◆ add_child()

backup_optigroup::add_child ( $element)

Reimplemented from base_nested_element.

◆ add_final_elements()

base_optigroup::add_final_elements ( $attributes)
inherited

Adding final elements is forbidden.

Reimplemented from base_nested_element.

◆ add_used()

base_optigroup::add_used ( $element)
protectedinherited

Recalculate all the used elements in the optigroup, observing restrictions and passing the new used to outer level.

Reimplemented from base_nested_element.

◆ clean_value()

base_nested_element::clean_value ( )
inherited

Reimplemented from base_atom.

◆ clean_values()

base_nested_element::clean_values ( )
inherited

Reimplemented from base_final_element.

◆ destroy()

base_nested_element::destroy ( )
inherited

Destroy all circular references.

It helps PHP 5.2 a lot!

Reimplemented from base_final_element.

◆ get_level()

base_optigroup::get_level ( )
inherited

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.

◆ get_new_attribute()

base_optigroup::get_new_attribute ( $name)
protectedinherited

Instantiating attributes is forbidden.

Reimplemented from base_final_element.

◆ get_new_final_element()

base_optigroup::get_new_final_element ( $name)
protectedinherited

Instantiating final elements is forbidden.

Reimplemented from base_nested_element.

◆ get_value()

base_nested_element::get_value ( )
inherited

Reimplemented from base_atom.

◆ process()

backup_optigroup::process ( $processor)

This function will call to the corresponding processor method in other to make them perform the desired tasks.

Implements processable.

◆ set_parent()

base_optigroup::set_parent ( $element)
protectedinherited

Set the parent of the optigroup and, at the same time, process all the condition params in all the childs.

Reimplemented from base_final_element.

◆ set_value()

base_nested_element::set_value ( $value)
inherited

Reimplemented from base_atom.

◆ to_string()

base_optigroup::to_string ( $showvalue = false)
inherited

Reimplemented from base_nested_element.


The documentation for this class was generated from the following file: