MDL-75025 backup: Final deprecation of base_controller::get/set_copy
Signed-off-by: Daniel Ziegenberg <[email protected]>
This commit is contained in:
@@ -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__]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user