This structure step restores the grade items associated with one activity All the grade items are made child of the "course" grade item but the original categoryid is saved as parentitemid in the backup_ids table, so, when restoring the complete gradebook (categories and calculations), that information is available there.
More...
|
| 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.
|
|
| after_restore () |
| This method will be executed after the rest of the restore has been processed. More...
|
|
| 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. More...
|
|
| decrypt ($value) |
| Returns symmetric-key AES-256 decryption of base64 encoded contents. More...
|
|
| destroy () |
| Destroy all circular references. More...
|
|
| execute () |
| This function will perform all the actions necessary to achieve the execution of the plan/part/task. 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_name () |
|
| 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_task () |
| As far as restore structure steps are implementing restore_plugin stuff, they need to have the parent task available for wrapping purposes (get course/context....) More...
|
|
| grouped_parent_exists ($pelement, $elements) |
| Given one pathelement, return true if grouped parent was found. More...
|
|
| launch_after_restore_methods () |
| Launch all the after_restore methods present in all the processing objects. More...
|
|
| log ($message, $level, $a=null, $depth=null, $display=false) |
| This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed. More...
|
|
| process ($data) |
| Receive one chunk of information form the xml parser processor and dispatch it, following the naming rules.
|
|
| 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...
|
|
| set_task ($task) |
|
|
| add_plugin_structure ($plugintype, $element) |
| Add plugin structure to any element in the structure restore tree. More...
|
|
| add_subplugin_structure ($subplugintype, $element, $plugintype=null, $pluginname=null) |
| Add subplugin structure for a given plugin to any element in the structure restore tree. More...
|
|
| after_execute () |
| This method will be executed after the whole structure step have been processed. More...
|
|
| define_structure () |
| Function that will return the structure to be processed by this restore_step. More...
|
|
| execute_condition () |
| No grades in front page. More...
|
|
| get_basepath () |
|
| get_courseid () |
|
| get_logger () |
|
| get_restoreid () |
|
| get_setting ($name) |
|
| get_setting_value ($name) |
|
| get_settings () |
| Protected API starts here.
|
|
| launch_after_execute_methods () |
| Launch all the after_execute methods present in all the processing objects. More...
|
|
| prepare_pathelements ($elementsarr) |
| Prepare the pathelements for processing, looking for duplicates, applying processing objects and other adjustments.
|
|
| process_grade_grade ($data) |
|
| process_grade_item ($data) |
|
| process_grade_letter ($data) |
| process activity grade_letters. More...
|
|
| setting_exists ($name) |
|
This structure step restores the grade items associated with one activity All the grade items are made child of the "course" grade item but the original categoryid is saved as parentitemid in the backup_ids table, so, when restoring the complete gradebook (categories and calculations), that information is available there.
restore_structure_step::add_subplugin_structure |
( |
|
$subplugintype, |
|
|
|
$element, |
|
|
|
$plugintype = null , |
|
|
|
$pluginname = null |
|
) |
| |
|
protectedinherited |
Add subplugin structure for a given plugin to any element in the structure restore tree.
This method allows the injection of subplugins (of a specific plugin) parsing and proccessing to any element in the restore structure.
NOTE: Initially subplugins were only available for activities (mod), so only the restore_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.
- Parameters
-
string | $subplugintype | type of subplugin as defined in plugin's db/subplugins.json. |
restore_path_element | $element | element in the structure restore tree that we are going to add subplugin information to. |
string | $plugintype | type of the plugin. |
string | $pluginname | name of the plugin. |
- Return values
-
restore_step::decrypt |
( |
|
$value | ) |
|
|
inherited |
Returns symmetric-key AES-256 decryption of base64 encoded contents.
This method is used in restore operations to decrypt contents encrypted with encrypted_final_element automatically decoding (base64) and decrypting contents using the key stored in backup_encryptkey config.
Requires openssl, cipher availability, and key existence (backup automatically sets it if missing). Integrity is provided via HMAC.
- Parameters
-
- Return values
-
string|null | decoded and decrypted value or null if the operation can not be performed. |
restore_structure_step::launch_after_execute_methods |
( |
| ) |
|
|
protectedinherited |
Launch all the after_execute methods present in all the processing objects.
This method will launch all the after_execute methods that can be defined both in restore_plugin and restore_structure_step classes
For restore_plugin classes the name of the method to be executed will be "after_execute_" + connection point (as far as can be multiple connection points in the same class)
For restore_structure_step classes is will be, simply, "after_execute". Note that this is executed after the plugin ones
restore_activity_grades_structure_step::process_grade_letter |
( |
|
$data | ) |
|
|
protected |
process activity grade_letters.
Note that, while these are possible, because grade_letters are contextid based, in practice, only course context letters can be defined. So we keep here this method knowing it won't be executed ever. gradebook restore will restore course letters.