backup MDL-26572 add new param to plugin and subplugin functions

This commit is contained in:
Eloy Lafuente (stronk7) 2011-03-07 00:16:25 +01:00
parent 07a36633f9
commit 4b43b1074f
3 changed files with 13 additions and 6 deletions

View File

@ -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);
}
/**

View File

@ -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);
}
/**

View File

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