Moodle  2.2.1
http://www.collinsharper.com
restore_subplugin Class Reference
Inheritance diagram for restore_subplugin:

Public Member Functions

 __construct ($subplugintype, $subpluginname, $step)
 define_subplugin_structure ($connectionpoint)
 launch_after_execute_methods ()

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

 $subplugintype
 $subpluginname
 $connectionpoint
 $step
 $task

Detailed Description

Class implementing the subplugins support for moodle2 restore

TODO: Finish phpdocs TODO: Make this subclass of restore_plugin TODO: Add support for declaring decode_contents (not decode_rules)

Definition at line 32 of file restore_subplugin.class.php.


Constructor & Destructor Documentation

__construct ( subplugintype,
subpluginname,
step 
)

Definition at line 40 of file restore_subplugin.class.php.


Member Function Documentation

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 144 of file restore_subplugin.class.php.

Here is the caller graph for this function:

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 153 of file restore_subplugin.class.php.

Here is the caller graph for this function:

define_subplugin_structure ( connectionpoint)

Definition at line 48 of file restore_subplugin.class.php.

get_mapping ( itemname,
oldid 
) [protected]

Return the complete mapping from the given itemname, itemid

Definition at line 137 of file restore_subplugin.class.php.

Here is the caller graph for this function:

get_mappingid ( itemname,
oldid,
ifnotfound = false 
) [protected]

Return the new id of a mapping for the given itemname

Parameters:
string$itemnamethe type of item
int$oldidthe item ID from the backup
mixed$ifnotfoundwhat to return if $oldid wasnt found. Defaults to false

Definition at line 130 of file restore_subplugin.class.php.

Here is the caller graph for this function:

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 173 of file restore_subplugin.class.php.

Here is the caller graph for this function:

get_new_parentid ( itemname) [protected]

Returns the latest (parent) new id mapped by one pathelement

Definition at line 119 of file restore_subplugin.class.php.

Here is the caller graph for this function:

get_old_parentid ( itemname) [protected]

Returns the latest (parent) old id mapped by one pathelement

Definition at line 112 of file restore_subplugin.class.php.

Here is the caller graph for this function:

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 182 of file restore_subplugin.class.php.

Here is the caller graph for this function:

get_restoreid ( ) [protected]

Definition at line 89 of file restore_subplugin.class.php.

Here is the caller graph for this function:

get_setting_value ( name) [protected]

Returns the value of one (task/plan) setting

Definition at line 160 of file restore_subplugin.class.php.

after_execute dispatcher for any restore_subplugin 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 subplugin classes with multiple connection points will support multiple after_execute methods, one for each connection point

Definition at line 77 of file restore_subplugin.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 105 of file restore_subplugin.class.php.

Here is the caller graph for this function:


Field Documentation

$connectionpoint [protected]

Definition at line 36 of file restore_subplugin.class.php.

$step [protected]

Definition at line 37 of file restore_subplugin.class.php.

$subpluginname [protected]

Definition at line 35 of file restore_subplugin.class.php.

$subplugintype [protected]

Definition at line 34 of file restore_subplugin.class.php.

$task [protected]

Definition at line 38 of file restore_subplugin.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations