by David Mudrák.
It depends of whether you need to attach your local plugin's data to
the course, the section or a module instance in the backup. Given that
your plugin is called local_foobar
, the following should work (not
tested) to attach your plugin's data to other modules' data.
// backup/moodle2/backup_local_foobar_plugin.class.php
class backup_local_foobar_plugin extends backup_local_plugin {
/**
* Returns the information to be attached to a module instance
*/
protected function define_module_plugin_structure() {
$plugin = $this->get_plugin_element();
$foobar = new backup_nested_element($this->get_recommended_name());
$plugin->add_child($filterurlresource);
// Continue here to add more child elements to your $foobar and
// set their data source as normally.
}
}
For an example of how to attach your plugin's data to a course and section, see e.g. this file - it is for a course format but it should work similarly AFAIK.