Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 220 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: stateupdates  - X-Ref

Class to track state actions.

The methods from this class should be executed via "stateactions" methods.

Each format plugin could extend this class to provide new updates to the frontend
mutation module.
Extended classes should be located in "format_XXX\course" namespace and
extends {@see \core_courseformat\stateupdates}.

__construct(course_format $format)   X-Ref
State update class constructor.

param: course_format $format Course format.

jsonSerialize()   X-Ref
Return the data to serialize the current track in JSON.

return: stdClass the statement data structure

add_course_put()   X-Ref
Add track about a general course state change.


add_section_put(int $sectionid)   X-Ref
Add track about a section state put.

param: int $sectionid The affected section id.

add_section_create(int $sectionid)   X-Ref
Add track about a new section created.

param: int $sectionid The affected section id.

create_or_put_section(int $sectionid, string $action)   X-Ref
Add track about section created or put.

param: int $sectionid The affected section id.
param: string $action The action to track for the section ('create' or 'put').

add_section_delete(int $sectionid)   X-Ref
Add track about a section deleted.

param: int $sectionid The affected section id.

add_section_remove(int $sectionid)   X-Ref
Add track about a section removed.

param: int $sectionid The affected section id.

add_cm_put(int $cmid)   X-Ref
Add track about a course module state update.

param: int $cmid the affected course module id

add_cm_create(int $cmid)   X-Ref
Add track about a course module created.

param: int $cmid the affected course module id

create_or_put_cm(int $cmid, string $action)   X-Ref
Add track about section created or put.

param: int $cmid The affected course module id.
param: string $action The action to track for the section ('create' or 'put').

add_cm_delete(int $cmid)   X-Ref
Add track about a course module deleted.

param: int $cmid the affected course module id

add_cm_remove(int $cmid)   X-Ref
Add track about a course module removed.

param: int $cmid the affected course module id

add_update(string $name, string $action, stdClass $fields)   X-Ref
Add a valid update message to the update list.

param: string $name the update name
param: string $action the update action (usually update, create, remove)
param: stdClass $fields the object fields