. /** * Define all the backup steps that will be used by the backup_newmodule_activity_task * * The AppStream Plugin does not support backup and recovery. It is disabled in lib.php. * * @package mod_appstream * @copyright 2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 */ defined('MOODLE_INTERNAL') || die; class backup_appstream_activity_structure_step extends backup_activity_structure_step { /** * Defines the backup structure of the module * * @return backup_nested_element */ protected function define_structure() { // Get know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); // Define the root element describing the appstream instance. $appstream = new backup_nested_element('appstream', array('id'), array( 'name', 'intro', 'introformat', 'grade')); // If we had more elements, we would build the tree here. // Define data sources. $appstream->set_source_table('appstream', array('id' => backup::VAR_ACTIVITYID)); // If we were referring to other tables, we would annotate the relation // with the element's annotate_ids() method. // Define file annotations (we do not use itemid in this example). $appstream->annotate_files('mod_appstream', 'intro', null); // Return the root element (appstream), wrapped into standard activity structure. return $this->prepare_activity_structure($appstream); } }