MDL-74925 course: use the correct 'remove' action
This commit is contained in:
@@ -134,6 +134,15 @@ class stateupdates implements JsonSerializable {
|
||||
$this->add_update('section', 'remove', (object)['id' => $sectionid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add track about a section removed.
|
||||
*
|
||||
* @param int $sectionid The affected section id.
|
||||
*/
|
||||
public function add_section_remove(int $sectionid): void {
|
||||
$this->add_update('section', 'remove', (object)['id' => $sectionid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add track about a course module state update.
|
||||
*
|
||||
@@ -184,11 +193,20 @@ class stateupdates implements JsonSerializable {
|
||||
$this->add_update('cm', 'remove', (object)['id' => $cmid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add track about a course module removed.
|
||||
*
|
||||
* @param int $cmid the affected course module id
|
||||
*/
|
||||
public function add_cm_remove(int $cmid): void {
|
||||
$this->add_update('cm', 'remove', (object)['id' => $cmid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a valid update message to the update list.
|
||||
*
|
||||
* @param string $name the update name
|
||||
* @param string $action the update action (usually update, create, delete)
|
||||
* @param string $action the update action (usually update, create, remove)
|
||||
* @param stdClass $fields the object fields
|
||||
*/
|
||||
protected function add_update(string $name, string $action, stdClass $fields): void {
|
||||
|
||||
Reference in New Issue
Block a user