Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

(no description)

Copyright: 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 179 lines (6 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 2 classes

base_optigroup:: (11 methods):
  __construct()
  get_level()
  to_string()
  add_attributes()
  get_new_attribute()
  add_final_elements()
  get_new_final_element()
  add_children()
  set_parent()
  add_used()
  is_multiple()

base_optigroup_exception:: (1 method):
  __construct()


Class: base_optigroup  - X-Ref

Abstract class representing one optigroup for conditional branching

__construct($name, $elements = null, $multiple = false)   X-Ref
Constructor - instantiates one base_optigroup, specifying its basic info

param: string $name name of the element
param: array $elements base_optigroup_elements of this group
param: bool $multiple to decide if the group allows multiple branches processing or no

get_level()   X-Ref
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.


to_string($showvalue = false)   X-Ref
No description

add_attributes($attributes)   X-Ref
Adding attributes is forbidden


get_new_attribute($name)   X-Ref
Instantiating attributes is forbidden


add_final_elements($attributes)   X-Ref
Adding final elements is forbidden


get_new_final_element($name)   X-Ref
Instantiating final elements is forbidden


add_children($elements)   X-Ref
No description

set_parent($element)   X-Ref
Set the parent of the optigroup and, at the same time, process all the
condition params in all the childs


add_used($element)   X-Ref
Recalculate all the used elements in the optigroup, observing
restrictions and passing the new used to outer level


is_multiple()   X-Ref
No description

Class: base_optigroup_exception  - X-Ref

base_optigroup_exception to control all the errors while building the optigroups

This exception will be thrown each time the base_optigroup class detects some
inconsistency related with the building of the group
__construct($errorcode, $a = null, $debuginfo = null)   X-Ref
Constructor - instantiates one base_optigroup_exception

param: string $errorcode key for the corresponding error string
param: object $a extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information