mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
Merge branch 'MDL-75025_final-deprecation-of-base_controller-set_copy' of https://github.com/ziegenberg/moodle
This commit is contained in:
commit
b964baf06e
3 changed files with 21 additions and 28 deletions
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.
|
* @deprecated since Moodle 4.1 MDL-74548
|
||||||
*
|
|
||||||
* 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()
|
|
||||||
*/
|
*/
|
||||||
public function set_copy(\stdClass $data): void {
|
#[\core\attribute\deprecated(since: '4.1', mdl: 'MDL-74548', final: true)]
|
||||||
debugging('The method base_controller::set_copy() is deprecated.
|
public function set_copy(): void {
|
||||||
Please use the restore_controller class instead.', DEBUG_DEVELOPER);
|
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the course copy data.
|
* @deprecated since Moodle 4.1 MDL-74548
|
||||||
*
|
|
||||||
* @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 {
|
#[\core\attribute\deprecated('restore_controller::get_copy()', since: '4.1', mdl: 'MDL-74548', final: true)]
|
||||||
debugging('The method base_controller::get_copy() is deprecated.
|
public function get_copy() {
|
||||||
Please use restore_controller::get_copy() instead.', DEBUG_DEVELOPER);
|
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||||
return $this->copy;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue