From 4b43b1074f112a39a745f28affceb6fa0fd2e04b Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 7 Mar 2011 00:16:25 +0100 Subject: [PATCH] backup MDL-26572 add new param to plugin and subplugin functions --- backup/moodle2/restore_plugin.class.php | 7 +++++-- backup/moodle2/restore_subplugin.class.php | 7 +++++-- backup/util/plan/restore_structure_step.class.php | 5 +++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/backup/moodle2/restore_plugin.class.php b/backup/moodle2/restore_plugin.class.php index 8103adaeeec..02039876352 100644 --- a/backup/moodle2/restore_plugin.class.php +++ b/backup/moodle2/restore_plugin.class.php @@ -174,9 +174,12 @@ abstract class restore_plugin { /** * Return the new id of a mapping for the given itemname * + * @param string $itemname the type of item + * @param int $oldid the item ID from the backup + * @param mixed $ifnotfound what to return if $oldid wasnt found. Defaults to false */ - protected function get_mappingid($itemname, $oldid) { - return $this->step->get_mappingid($itemname, $oldid); + protected function get_mappingid($itemname, $oldid, $ifnotfound = false) { + return $this->step->get_mappingid($itemname, $oldid, $ifnotfound); } /** diff --git a/backup/moodle2/restore_subplugin.class.php b/backup/moodle2/restore_subplugin.class.php index d22a0d9c1f8..8972e358405 100644 --- a/backup/moodle2/restore_subplugin.class.php +++ b/backup/moodle2/restore_subplugin.class.php @@ -123,9 +123,12 @@ abstract class restore_subplugin { /** * Return the new id of a mapping for the given itemname * + * @param string $itemname the type of item + * @param int $oldid the item ID from the backup + * @param mixed $ifnotfound what to return if $oldid wasnt found. Defaults to false */ - protected function get_mappingid($itemname, $oldid) { - return $this->step->get_mappingid($itemname, $oldid); + protected function get_mappingid($itemname, $oldid, $ifnotfound = false) { + return $this->step->get_mappingid($itemname, $oldid, $ifnotfound); } /** diff --git a/backup/util/plan/restore_structure_step.class.php b/backup/util/plan/restore_structure_step.class.php index 927f71c7f01..ae648bc4911 100644 --- a/backup/util/plan/restore_structure_step.class.php +++ b/backup/util/plan/restore_structure_step.class.php @@ -196,9 +196,10 @@ abstract class restore_structure_step extends restore_step { /** * Return the new id of a mapping for the given itemname - * @param string $itemname the type of item. For example 'scale' or 'outcome' + * + * @param string $itemname the type of item * @param int $oldid the item ID from the backup - * @param $ifnotfound what to return if $oldid wasnt found + * @param mixed $ifnotfound what to return if $oldid wasnt found. Defaults to false */ public function get_mappingid($itemname, $oldid, $ifnotfound = false) { $mapping = $this->get_mapping($itemname, $oldid);