Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
restore_format_weeks_plugin Class Reference
Inheritance diagram for restore_format_weeks_plugin:
restore_format_plugin restore_plugin

Public Member Functions

 after_restore_course ()
 Executed after course restore is complete. More...
 
 define_course_plugin_structure ()
 Creates a dummy path element in order to be able to execute code after restore. More...
 
 define_plugin_structure ($connectionpoint)
 
 launch_after_execute_methods ()
 after_execute dispatcher for any restore_plugin class More...
 
 launch_after_restore_methods ()
 after_restore dispatcher for any restore_plugin class More...
 
 process_dummy_course ()
 Dummy process method.
 

Static Public Member Functions

static define_plugin_decode_contents ()
 Define the contents in the plugin that must be processed by the link decoder.
 
static get_restore_decode_contents ($plugintype)
 Returns one array with all the decode contents to be processed by the links decoder. 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.
 
 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.
 
 get_task ()
 Get the task we are part of. More...
 
 is_pre_33_backup ()
 Checks if backup file was made on Moodle before 3.3 and we should respect the 'numsections' and potential "orphaned" sections in the end of the course. 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...
 
 update_automatic_end_date ($enddate)
 Handles setting the automatic end date for a restored course. More...
 
 update_course_sections_visibility ($numsections)
 Handles updating the visibility of sections in the restored course. More...
 

Protected Attributes

string $connectionpoint
 
int $originalnumsections = 0
 
string $pluginname
 
string $plugintype
 
restore_structure_step $step
 
restore_course_task restore_activity_task $task
 

Member Function Documentation

◆ after_restore_course()

restore_format_weeks_plugin::after_restore_course ( )

Executed after course restore is complete.

This method is only executed if course configuration was overridden

◆ define_course_plugin_structure()

restore_format_weeks_plugin::define_course_plugin_structure ( )

Creates a dummy path element in order to be able to execute code after restore.

Return values
restore_path_element[]

◆ get_mappingid()

restore_plugin::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_plugin::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 ;-)

◆ get_restore_decode_contents()

static restore_plugin::get_restore_decode_contents (   $plugintype)
staticinherited

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

◆ get_task()

restore_plugin::get_task ( )
protectedinherited

Get the task we are part of.

Return values
restore_activity_task|restore_course_taskthe task.

◆ is_pre_33_backup()

restore_format_weeks_plugin::is_pre_33_backup ( )
protected

Checks if backup file was made on Moodle before 3.3 and we should respect the 'numsections' and potential "orphaned" sections in the end of the course.

Return values
bool

◆ launch_after_execute_methods()

restore_plugin::launch_after_execute_methods ( )
inherited

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

◆ launch_after_restore_methods()

restore_plugin::launch_after_restore_methods ( )
inherited

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

◆ set_mapping()

restore_plugin::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

◆ update_automatic_end_date()

restore_format_weeks_plugin::update_automatic_end_date (   $enddate)
protected

Handles setting the automatic end date for a restored course.

Parameters
int$enddateThe end date in the backup file.

◆ update_course_sections_visibility()

restore_format_weeks_plugin::update_course_sections_visibility (   $numsections)
protected

Handles updating the visibility of sections in the restored course.

Parameters
int$numsectionsThe number of sections in the restored course.

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