From 2ac93db3991c0317494cc8d06a3825dc6e94cded Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Wed, 11 May 2022 15:50:25 +0800 Subject: [PATCH] MDL-74548 backup: Deprecate get/set copy from base controller --- backup/controller/base_controller.class.php | 10 ++++++++++ backup/upgrade.txt | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/backup/controller/base_controller.class.php b/backup/controller/base_controller.class.php index 8e8d0d10d2b..57dc8674ab0 100644 --- a/backup/controller/base_controller.class.php +++ b/backup/controller/base_controller.class.php @@ -111,8 +111,13 @@ abstract class base_controller extends backup implements loggable { * * @param \stdClass $data The course copy data. * @throws backup_controller_exception + * @deprecated since Moodle 4.1 MDL-74548 - please do not use this method anymore. + * @todo MDL-75025 This method will be deleted in Moodle 4.5 + * @see restore_controller::__construct() */ public function set_copy(\stdClass $data): void { + debugging('The method base_controller::set_copy() is deprecated. + Please use the restore_controller class instead.', DEBUG_DEVELOPER); // Only allow setting of copy data when controller is in copy mode. if ($this->mode != backup::MODE_COPY) { throw new backup_controller_exception('cannot_set_copy_vars_wrong_mode'); @@ -124,8 +129,13 @@ abstract class base_controller extends backup implements loggable { * Get the course copy data. * * @return \stdClass + * @deprecated since Moodle 4.1 MDL-74548 - please do not use this method anymore. + * @todo MDL-75026 This method will be deleted in Moodle 4.5 + * @see restore_controller::get_copy() */ public function get_copy(): \stdClass { + debugging('The method base_controller::get_copy() is deprecated. + Please use restore_controller::get_copy() instead.', DEBUG_DEVELOPER); return $this->copy; } } diff --git a/backup/upgrade.txt b/backup/upgrade.txt index e2c7b51dd91..d53f920f0b9 100644 --- a/backup/upgrade.txt +++ b/backup/upgrade.txt @@ -5,6 +5,10 @@ information provided here is intended especially for developers. * The class core_backup\copy\copy in backup/util/ui/classes/copy.php has been deprecated, please use copy_helper from backup/util/helper/copy_helper.class.php instead. +* The method set_copy() in backup/controller/base_controller.class.php has been deprecated, please use a restore + controller for storing copy information instead. +* The method get_copy() in backup/controller/base_controller.class.php has been deprecated, please use get_copy() + from backup/controller/restore_controller.class.php instead. === 4.0 ===