MDL-74925 core_course: initial deprecation of '_delete' methods

This commit is contained in:
Simey Lameze 2022-07-13 12:07:27 +08:00
parent 45dfb5ac84
commit 5294f81c27
2 changed files with 10 additions and 0 deletions

View File

@ -128,9 +128,12 @@ class stateupdates implements JsonSerializable {
/**
* Add track about a section deleted.
*
* @deprecated since Moodle 4.1 MDL-74925 - please call add_section_remove() instead.
* @param int $sectionid The affected section id.
*/
public function add_section_delete(int $sectionid): void {
debugging('add_section_delete() is deprecated. Please use add_section_remove() instead.', DEBUG_DEVELOPER);
$this->add_update('section', 'remove', (object)['id' => $sectionid]);
}
@ -187,9 +190,12 @@ class stateupdates implements JsonSerializable {
/**
* Add track about a course module deleted.
*
* @deprecated since Moodle 4.1 MDL-74925 - please call add_cm_remove() instead.
* @param int $cmid the affected course module id
*/
public function add_cm_delete(int $cmid): void {
debugging('add_cm_delete() is deprecated. Please use add_cm_remove() instead.', DEBUG_DEVELOPER);
$this->add_update('cm', 'remove', (object)['id' => $cmid]);
}

View File

@ -2,6 +2,10 @@ This files describes API changes for course formats
Overview of this plugin type at http://docs.moodle.org/dev/Course_formats
=== 4.1 ===
* New \core_courseformat\stateupdates methods add_section_remove() and add_cm_remove() have been added to replace
the deprecated methods add_section_delete() and add_cm_delete().
=== 4.0 ===
* New core_courseformat\base::uses_course_index() to define whether the course format uses course index or not.
* New core_courseformat\base::supports_components() to specify if the format is compatible with reactive components.