From 1e37c39180de4566fd58a1a2a4853b4c76bfe265 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 10 Feb 2011 11:34:41 +0100 Subject: [PATCH] MDL-22146 backup & restore - extending the restore plugins API --- backup/moodle2/restore_plugin.class.php | 12 ++++++++++++ backup/moodle2/restore_subplugin.class.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/backup/moodle2/restore_plugin.class.php b/backup/moodle2/restore_plugin.class.php index 3f9f5bb73b9..8103adaeeec 100644 --- a/backup/moodle2/restore_plugin.class.php +++ b/backup/moodle2/restore_plugin.class.php @@ -202,6 +202,18 @@ abstract class restore_plugin { return $this->step->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 ;-) diff --git a/backup/moodle2/restore_subplugin.class.php b/backup/moodle2/restore_subplugin.class.php index 7f2b175a74e..d22a0d9c1f8 100644 --- a/backup/moodle2/restore_subplugin.class.php +++ b/backup/moodle2/restore_subplugin.class.php @@ -151,6 +151,18 @@ abstract class restore_subplugin { return $this->step->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 ;-)