June 2017
Beginner to intermediate
368 pages
8h 31m
English
As one can imagine, restoring is essentially the reverse of backing up. Details of the Restore API are to be found in the developer documentation at: https://docs.moodle.org/dev/Restore_API#API_for_activity_modules.
The restore_wavefront_activity_structure_step class defined in restore_wavefront_stepslib.php needs to provide one function per database table that describes how data should be taken from the backup and inserted back into the database. The following example covers user comments:
protected function process_wavefront_comment($data){ global $DB; $data = (object)$data; $data->wavefront = $this->get_new_parentid('wavefront'); $data->userid = $this->get_mappingid('user', $data->userid); $data->timemodified = $this->apply_date_offset($data- ...Read now
Unlock full access