Skip to content

Commit

Permalink
MDL-74548 backup: Deprecate get/set copy from base controller
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron1729 committed Jun 29, 2022
1 parent 2f22088 commit 59b6d34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backup/controller/base_controller.class.php
Expand Up @@ -111,8 +111,13 @@ public function get_releasesession() {
*
* @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');
Expand All @@ -124,8 +129,13 @@ public function set_copy(\stdClass $data): void {
* 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;
}
}
4 changes: 4 additions & 0 deletions backup/upgrade.txt
Expand Up @@ -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 ===

Expand Down

0 comments on commit 59b6d34

Please sign in to comment.