Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(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: 268 lines (10 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 2 classes

base_nested_element:: (19 methods):
  __construct()
  destroy()
  get_used()
  set_used()
  add_used()
  check_and_set_used()
  get_final_elements()
  get_final_element()
  get_children()
  get_child()
  get_optigroup()
  add_final_elements()
  add_child()
  add_optigroup()
  get_value()
  set_value()
  clean_value()
  clean_values()
  to_string()

base_element_struct_exception:: (1 method):
  __construct()


Class: base_nested_element  - X-Ref

Abstract class representing one nestable element (non final) piece of information

__construct($name, $attributes = null, $final_elements = null)   X-Ref
Constructor - instantiates one base_nested_element, specifying its basic info.

param: string $name name of the element
param: array  $attributes attributes this element will handle (optional, defaults to null)
param: array  $final_elements this element will handle (optional, defaults to null)

destroy()   X-Ref
Destroy all circular references. It helps PHP 5.2 a lot!


get_used()   X-Ref
No description

set_used($used)   X-Ref
No description

add_used($element)   X-Ref
No description

check_and_set_used($element)   X-Ref
No description

get_final_elements()   X-Ref
No description

get_final_element($name)   X-Ref
No description

get_children()   X-Ref
No description

get_child($name)   X-Ref
No description

get_optigroup()   X-Ref
No description

add_final_elements($final_elements)   X-Ref
No description

add_child($element)   X-Ref
No description

add_optigroup($optigroup)   X-Ref
No description

get_value()   X-Ref
No description

set_value($value)   X-Ref
No description

clean_value()   X-Ref
No description

clean_values()   X-Ref
No description

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

Class: base_element_struct_exception  - X-Ref

base_element exception to control all the errors while building the nested tree

This exception will be thrown each time the base_element class detects some
inconsistency related with the building of the nested tree representing one base part
(invalid objects, circular references, double parents...)
__construct($errorcode, $a = null, $debuginfo = null)   X-Ref
Constructor - instantiates one base_element_struct_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