mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-75025 backup: Final deprecation of base_controller::get/set_copy
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
This commit is contained in:
parent
ad7fc69c25
commit
8723c4099b
7
.upgradenotes/MDL-75025-2024062015422824.yml
Normal file
7
.upgradenotes/MDL-75025-2024062015422824.yml
Normal file
@ -0,0 +1,7 @@
|
||||
issueNumber: MDL-75025
|
||||
notes:
|
||||
core_backup:
|
||||
- message: >-
|
||||
Final deprecation of base_controller::get_copy(). Please use
|
||||
restore_controller::get_copy() instead.
|
||||
type: removed
|
6
.upgradenotes/MDL-75025-2024062015430029.yml
Normal file
6
.upgradenotes/MDL-75025-2024062015430029.yml
Normal file
@ -0,0 +1,6 @@
|
||||
issueNumber: MDL-75025
|
||||
notes:
|
||||
core_backup:
|
||||
- message: 'Final deprecation of base_controller::set_copy(). Please use a restore
|
||||
controller for storing copy information instead.'
|
||||
type: removed
|
@ -107,38 +107,18 @@ abstract class base_controller extends backup implements loggable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Store extra data for course copy operations.
|
||||
*
|
||||
* For a course copying these is data required to be passed to the restore step.
|
||||
* We store this data in its own section of the backup controller
|
||||
*
|
||||
* @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()
|
||||
* @deprecated since Moodle 4.1 MDL-74548
|
||||
*/
|
||||
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');
|
||||
}
|
||||
$this->copy = $data;
|
||||
#[\core\attribute\deprecated(since: '4.1', mdl: 'MDL-74548', final: true)]
|
||||
public function set_copy(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
* @deprecated since Moodle 4.1 MDL-74548
|
||||
*/
|
||||
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;
|
||||
#[\core\attribute\deprecated('restore_controller::get_copy()', since: '4.1', mdl: 'MDL-74548', final: true)]
|
||||
public function get_copy() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user