Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 402] [Versions 310 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: 263 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

backup_structure_step:: (6 methods):
  __construct()
  execute()
  get_task()
  add_plugin_structure()
  add_subplugin_structure()
  execute_condition()


Class: backup_structure_step  - X-Ref

Abstract class defining the needed stuff to backup one @backup_structure

TODO: Finish phpdocs
__construct($name, $filename, $task = null)   X-Ref
Constructor - instantiates one object of this class


execute()   X-Ref
No description

get_task()   X-Ref
As far as backup structure steps are implementing backup_plugin stuff, they need to
have the parent task available for wrapping purposes (get course/context....)


add_plugin_structure($plugintype, $element, $multiple)   X-Ref
Add plugin structure to any element in the structure backup tree

param: string $plugintype type of plugin as defined by core_component::get_plugin_types()
param: backup_nested_element $element element in the structure backup tree that
param: bool $multiple to define if multiple plugins can produce information

add_subplugin_structure($subplugintype, $element, $multiple, $plugintype = null, $pluginname = null)   X-Ref
Add subplugin structure for a given plugin to any element in the structure backup tree.

This method allows the injection of subplugins (of a specified plugin) data to any
element in any backup structure.

NOTE: Initially subplugins were only available for activities (mod), so only the
{@link backup_activity_structure_step} class had support for them, always
looking for /mod/modulenanme subplugins. This new method is a generalization of the
existing one for activities, supporting all subplugins injecting information everywhere.

param: string $subplugintype type of subplugin as defined in plugin's db/subplugins.json.
param: backup_nested_element $element element in the backup tree (anywhere) that
param: bool $multiple to define if multiple subplugins can produce information
param: string $plugintype type of the plugin.
param: string $pluginname name of the plugin.
return: void

execute_condition()   X-Ref
To conditionally decide if one step will be executed or no

For steps needing to be executed conditionally, based in dynamic
conditions (at execution time vs at declaration time) you must
override this function. It will return true if the step must be
executed and false if not