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

This commit is contained in:
Eloy Lafuente (stronk7) 2011-02-10 11:34:41 +01:00
parent 4fda584f28
commit 1e37c39180
2 changed files with 24 additions and 0 deletions

View File

@ -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 ;-)

View File

@ -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 ;-)