|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| __construct ($plugintype, $pluginname, $step) | |
| define_plugin_structure ($connectionpoint) | |
| launch_after_execute_methods () | |
| launch_after_restore_methods () | |
Static Public Member Functions | |
| static | get_restore_decode_contents ($plugintype) |
| static | define_plugin_decode_contents () |
Protected Member Functions | |
| get_restoreid () | |
| set_mapping ($itemname, $oldid, $newid, $restorefiles=false, $filesctxid=null, $parentid=null) | |
| get_old_parentid ($itemname) | |
| get_new_parentid ($itemname) | |
| get_mappingid ($itemname, $oldid, $ifnotfound=false) | |
| get_mapping ($itemname, $oldid) | |
| add_related_files ($component, $filearea, $mappingitemname, $filesctxid=null, $olditemid=null) | |
| apply_date_offset ($value) | |
| get_setting_value ($name) | |
| get_namefor ($name= '') | |
| get_pathfor ($path= '') | |
Protected Attributes | |
| $plugintype | |
| $pluginname | |
| $connectionpoint | |
| $step | |
| $task | |
Class implementing the plugins support for moodle2 restore
TODO: Finish phpdocs
Definition at line 30 of file restore_plugin.class.php.
| __construct | ( | $ | plugintype, |
| $ | pluginname, | ||
| $ | step | ||
| ) |
Definition at line 38 of file restore_plugin.class.php.
| add_related_files | ( | $ | component, |
| $ | filearea, | ||
| $ | mappingitemname, | ||
| $ | filesctxid = null, |
||
| $ | olditemid = null |
||
| ) | [protected] |
Add all the existing file, given their component and filearea and one backup_ids itemname to match with
Definition at line 212 of file restore_plugin.class.php.
| apply_date_offset | ( | $ | value | ) | [protected] |
Apply course startdate offset based in original course startdate and course_offset_startdate setting Note we are using one static cache here, but *by restoreid*, so it's ok for concurrence/multiple executions in the same request
Definition at line 221 of file restore_plugin.class.php.
| static define_plugin_decode_contents | ( | ) | [static] |
Define the contents in the plugin that must be processed by the link decoder
Reimplemented in restore_qtype_plugin.
Definition at line 149 of file restore_plugin.class.php.
| define_plugin_structure | ( | $ | connectionpoint | ) |
Reimplemented in restore_plagiarism_plugin.
Definition at line 46 of file restore_plugin.class.php.
| get_mapping | ( | $ | itemname, |
| $ | oldid | ||
| ) | [protected] |
Return the complete mapping from the given itemname, itemid
Definition at line 205 of file restore_plugin.class.php.
| get_mappingid | ( | $ | itemname, |
| $ | oldid, | ||
| $ | ifnotfound = false |
||
| ) | [protected] |
Return the new id of a mapping for the given itemname
| string | $itemname | the type of item |
| int | $oldid | the item ID from the backup |
| mixed | $ifnotfound | what to return if $oldid wasnt found. Defaults to false |
Definition at line 198 of file restore_plugin.class.php.

| get_namefor | ( | $ | name = '' | ) | [protected] |
Simple helper function that returns the name for the restore_path_element It's not mandatory to use it but recommended ;-)
Definition at line 241 of file restore_plugin.class.php.
| get_new_parentid | ( | $ | itemname | ) | [protected] |
Returns the latest (parent) new id mapped by one pathelement
Definition at line 187 of file restore_plugin.class.php.

| get_old_parentid | ( | $ | itemname | ) | [protected] |
Returns the latest (parent) old id mapped by one pathelement
Definition at line 180 of file restore_plugin.class.php.

| get_pathfor | ( | $ | path = '' | ) | [protected] |
Simple helper function that returns the base (prefix) of the path for the restore_path_element Useful if we used get_recommended_name() in backup. It's not mandatory to use it but recommended ;-)
Definition at line 250 of file restore_plugin.class.php.

| static get_restore_decode_contents | ( | $ | plugintype | ) | [static] |
Returns one array with all the decode contents to be processed by the links decoder
This method, given one plugin type, returns one array of restore_decode_content objects that will be added to the restore decoder in order to perform modifications under the plugin contents.
The objects are retrieved by calling to the define_decode_contents method (when available), first in the main restore_xxxx_plugin class and later on each of the available subclasses
Definition at line 113 of file restore_plugin.class.php.


| get_restoreid | ( | ) | [protected] |
Definition at line 157 of file restore_plugin.class.php.

| get_setting_value | ( | $ | name | ) | [protected] |
Returns the value of one (task/plan) setting
Definition at line 228 of file restore_plugin.class.php.
after_execute dispatcher for any restore_plugin class
This method will dispatch execution to the corresponding after_execute_xxx() method when available, with xxx being the connection point of the instance, so plugin classes with multiple connection points will support multiple after_execute methods, one for each connection point
Definition at line 75 of file restore_plugin.class.php.
after_restore dispatcher for any restore_plugin class
This method will dispatch execution to the corresponding after_restore_xxx() method when available, with xxx being the connection point of the instance, so plugin classes with multiple connection points will support multiple after_restore methods, one for each connection point
Definition at line 92 of file restore_plugin.class.php.
| set_mapping | ( | $ | itemname, |
| $ | oldid, | ||
| $ | newid, | ||
| $ | restorefiles = false, |
||
| $ | filesctxid = null, |
||
| $ | parentid = null |
||
| ) | [protected] |
To send ids pairs to backup_ids_table and to store them into paths
This method will send the given itemname and old/new ids to the backup_ids_temp table, and, at the same time, will save the new id into the corresponding restore_path_element for easier access by children. Also will inject the known old context id for the task in case it's going to be used for restoring files later
Definition at line 173 of file restore_plugin.class.php.

$connectionpoint [protected] |
Definition at line 34 of file restore_plugin.class.php.
$pluginname [protected] |
Definition at line 33 of file restore_plugin.class.php.
$plugintype [protected] |
Definition at line 32 of file restore_plugin.class.php.
$step [protected] |
Definition at line 35 of file restore_plugin.class.php.
$task [protected] |
Definition at line 36 of file restore_plugin.class.php.