Permalink
Browse files

MDL-22146 backup & restore - extending the restore plugins API

  • Loading branch information...
1 parent 4fda584 commit 1e37c39180de4566fd58a1a2a4853b4c76bfe265 @stronk7 stronk7 committed Feb 10, 2011
Showing with 24 additions and 0 deletions.
  1. +12 −0 backup/moodle2/restore_plugin.class.php
  2. +12 −0 backup/moodle2/restore_subplugin.class.php
@@ -203,6 +203,18 @@ protected function apply_date_offset($value) {
}
/**
+ * Returns the value of one (task/plan) setting
+ */
+ protected function get_setting_value($name) {
+ if (is_null($this->task)) {
+ throw new restore_step_exception('not_specified_restore_task');
+ }
+ return $this->task->get_setting_value($name);
+ }
+
+// end of restore_step/structure_step/task wrappers
+
+ /**
* Simple helper function that returns the name for the restore_path_element
* It's not mandatory to use it but recommended ;-)
*/
@@ -152,6 +152,18 @@ protected function apply_date_offset($value) {
}
/**
+ * Returns the value of one (task/plan) setting
+ */
+ protected function get_setting_value($name) {
+ if (is_null($this->task)) {
+ throw new restore_step_exception('not_specified_restore_task');
+ }
+ return $this->task->get_setting_value($name);
+ }
+
+// end of restore_step/structure_step/task wrappers
+
+ /**
* Simple helper function that returns the name for the restore_path_element
* It's not mandatory to use it but recommended ;-)
*/

0 comments on commit 1e37c39

Please sign in to comment.