Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

(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: 361 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: backup_nested_element  - X-Ref

Instantiable class representing one nestable element (non final) piece of information on backup

__construct($name, $attributes = null, $final_elements = null)   X-Ref
Constructor - instantiates one backup_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)

process($processor)   X-Ref
Process the nested element

param: object $processor the processor
return: void

add_log($message, $level, $a = null, $depth = null, $display = false)   X-Ref
Saves a log message to an array

param: string $message to add to the logs
param: int $level level of importance {@link backup::LOG_DEBUG} and other constants
param: mixed $a to be included in $message
param: int $depth of the message
param: display $bool supporting translation via get_string() if true
return: void

add_result($result)   X-Ref
Saves the results to an array

param: array $result associative array
return: void

get_logs()   X-Ref
Returns the logs

return: array of log objects

get_results()   X-Ref
Returns the results

return: associative array of results

set_source_array($arr)   X-Ref
No description

set_source_table($table, $params, $sortby = null)   X-Ref
No description

set_source_sql($sql, $params)   X-Ref
No description

set_source_alias($dbname, $finalelementname)   X-Ref
No description

annotate_files($component, $filearea, $elementname, $filesctxid = null)   X-Ref
No description

annotate_ids($itemname, $elementname)   X-Ref
No description

get_file_annotations()   X-Ref
Returns one array containing the element in the


get_source_array()   X-Ref
No description

get_source_table()   X-Ref
No description

get_source_table_sortby()   X-Ref
No description

get_source_sql()   X-Ref
No description

get_counter()   X-Ref
No description

fill_values($values)   X-Ref
Simple filler that, matching by name, will fill both attributes and final elements
depending of this nested element, debugging info about non-matching elements and/or
elements present in both places. Accept both arrays and objects.


convert_table_params($params)   X-Ref
No description

convert_sql_params($params)   X-Ref
No description

find_element($param)   X-Ref
No description

get_new_attribute($name)   X-Ref
Returns one instace of the @base_attribute class to work with
when attributes are added simply by name


get_new_final_element($name)   X-Ref
Returns one instace of the @final_element class to work with
when final_elements are added simply by name


get_iterator($processor)   X-Ref
Returns one PHP iterator over each "ocurrence" of this nested
element (array or DB recordset). Delegated to backup_structure_dbops class