Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
restore_logstore_standard_subplugin Class Reference
Inheritance diagram for restore_logstore_standard_subplugin:
restore_tool_log_logstore_subplugin restore_subplugin

Public Member Functions

 define_subplugin_structure ($connectionpoint)
 
 launch_after_execute_methods ()
 after_execute dispatcher for any restore_subplugin class More...
 
 launch_after_restore_methods ()
 The after_restore dispatcher for any restore_subplugin class. More...
 
 log ($message, $level, $a=null, $depth=null, $display=false)
 Call the log function from the step.
 
 process_logstore_standard_log ($data)
 Process logstore_standard_log entries. More...
 

Protected Member Functions

 add_related_files ($component, $filearea, $mappingitemname, $filesctxid=null, $olditemid=null)
 Add all the existing file, given their component and filearea and one backup_ids itemname to match with.
 
 apply_date_offset ($value)
 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.
 
 define_logstore_subplugin_structure ()
 Returns the subplugin structure to attach to the 'logstore' XML element. More...
 
 get_mapping ($itemname, $oldid)
 Return the complete mapping from the given itemname, itemid.
 
 get_mappingid ($itemname, $oldid, $ifnotfound=false)
 Return the new id of a mapping for the given itemname. More...
 
 get_namefor ($name='')
 Simple helper function that returns the name for the restore_path_element It's not mandatory to use it but recommended ;-)
 
 get_new_parentid ($itemname)
 Returns the latest (parent) new id mapped by one pathelement.
 
 get_old_parentid ($itemname)
 Returns the latest (parent) old id mapped by one pathelement.
 
 get_pathfor ($path='')
 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. More...
 
 get_restoreid ()
 
 get_setting_value ($name)
 Returns the value of one (task/plan) setting.
 
 process_log ($data, bool $jsonformat=false)
 Process log entries. More...
 
 set_mapping ($itemname, $oldid, $newid, $restorefiles=false, $filesctxid=null, $parentid=null)
 To send ids pairs to backup_ids_table and to store them into paths. More...
 

Protected Attributes

 $connectionpoint
 
 $step
 
 $subpluginname
 
 $subplugintype
 
 $task
 

Member Function Documentation

◆ define_logstore_subplugin_structure()

restore_logstore_standard_subplugin::define_logstore_subplugin_structure ( )
protected

Returns the subplugin structure to attach to the 'logstore' XML element.

Return values
restore_path_element[]array of elements to be processed on restore.

◆ get_mappingid()

restore_subplugin::get_mappingid (   $itemname,
  $oldid,
  $ifnotfound = false 
)
protectedinherited

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

◆ get_pathfor()

restore_subplugin::get_pathfor (   $path = '')
protectedinherited

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 ;-)

◆ launch_after_execute_methods()

restore_subplugin::launch_after_execute_methods ( )
inherited

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

◆ launch_after_restore_methods()

restore_subplugin::launch_after_restore_methods ( )
inherited

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

◆ process_log()

restore_tool_log_logstore_subplugin::process_log (   $data,
bool  $jsonformat = false 
)
protectedinherited

Process log entries.

This method proceeds to read, complete, remap and, finally, discard or save every log entry.

Parameters
array$datalog entry.
bool$jsonformatIf true, uses JSON format for the 'other' field
Return values
object|null::$dataobjectA data object with values for one or more fields in the record, or null if we are not going to process the log.

◆ process_logstore_standard_log()

restore_logstore_standard_subplugin::process_logstore_standard_log (   $data)

Process logstore_standard_log entries.

This method proceeds to read, complete, remap and, finally, discard or save every log entry.

Parameters
array()$data log entry.

◆ set_mapping()

restore_subplugin::set_mapping (   $itemname,
  $oldid,
  $newid,
  $restorefiles = false,
  $filesctxid = null,
  $parentid = null 
)
protectedinherited

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


The documentation for this class was generated from the following file: