Class to track state actions.
More...
|
| __construct (course_format $format) |
| State update class constructor.
|
|
| add_cm_create (int $cmid) |
| Add track about a course module created.
|
|
| add_cm_delete (int $cmid) |
| Add track about a course module deleted.
|
|
| add_cm_put (int $cmid) |
| Add track about a course module state update.
|
|
| add_cm_remove (int $cmid) |
| Add track about a course module removed.
|
|
| add_course_put () |
| Add track about a general course state change.
|
|
| add_section_create (int $sectionid) |
| Add track about a new section created.
|
|
| add_section_delete (int $sectionid) |
| Add track about a section deleted.
|
|
| add_section_put (int $sectionid) |
| Add track about a section state put.
|
|
| add_section_remove (int $sectionid) |
| Add track about a section removed.
|
|
| jsonSerialize () |
| Return the data to serialize the current track in JSON.
|
|
|
| add_update (string $name, string $action, stdClass $fields) |
| Add a valid update message to the update list.
|
|
| create_or_put_cm (int $cmid, string $action) |
| Add track about section created or put.
|
|
| create_or_put_section (int $sectionid, string $action) |
| Add track about section created or put.
|
|
|
course_format | $format |
| format the course format
|
|
renderer_base | $output |
| renderer format renderer
|
|
array | $updates |
| the tracked updates
|
|
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 also
- core_courseformat\stateupdates}.
- Copyright
- 2021 Ferran Recio ferra.nosp@m.n@mo.nosp@m.odle..nosp@m.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_courseformat\stateupdates::__construct |
( |
course_format | $format | ) |
|
State update class constructor.
- Parameters
-
course_format | $format | Course format. |
◆ add_cm_create()
core_courseformat\stateupdates::add_cm_create |
( |
int | $cmid | ) |
|
Add track about a course module created.
- Parameters
-
int | $cmid | the affected course module id |
◆ add_cm_delete()
core_courseformat\stateupdates::add_cm_delete |
( |
int | $cmid | ) |
|
Add track about a course module deleted.
- Deprecated
- since Moodle 4.1 MDL-74925 - please call add_cm_remove() instead.
- Parameters
-
int | $cmid | the affected course module id |
◆ add_cm_put()
core_courseformat\stateupdates::add_cm_put |
( |
int | $cmid | ) |
|
Add track about a course module state update.
- Parameters
-
int | $cmid | the affected course module id |
◆ add_cm_remove()
core_courseformat\stateupdates::add_cm_remove |
( |
int | $cmid | ) |
|
Add track about a course module removed.
- Parameters
-
int | $cmid | the affected course module id |
◆ add_section_create()
core_courseformat\stateupdates::add_section_create |
( |
int | $sectionid | ) |
|
Add track about a new section created.
- Parameters
-
int | $sectionid | The affected section id. |
◆ add_section_delete()
core_courseformat\stateupdates::add_section_delete |
( |
int | $sectionid | ) |
|
Add track about a section deleted.
- Deprecated
- since Moodle 4.1 MDL-74925 - please call add_section_remove() instead.
- Parameters
-
int | $sectionid | The affected section id. |
◆ add_section_put()
core_courseformat\stateupdates::add_section_put |
( |
int | $sectionid | ) |
|
Add track about a section state put.
- Parameters
-
int | $sectionid | The affected section id. |
◆ add_section_remove()
core_courseformat\stateupdates::add_section_remove |
( |
int | $sectionid | ) |
|
Add track about a section removed.
- Parameters
-
int | $sectionid | The affected section id. |
◆ add_update()
core_courseformat\stateupdates::add_update |
( |
string | $name, |
|
|
string | $action, |
|
|
stdClass | $fields ) |
|
protected |
Add a valid update message to the update list.
- Parameters
-
string | $name | the update name |
string | $action | the update action (usually update, create, remove) |
stdClass | $fields | the object fields |
◆ create_or_put_cm()
core_courseformat\stateupdates::create_or_put_cm |
( |
int | $cmid, |
|
|
string | $action ) |
|
protected |
Add track about section created or put.
- Parameters
-
int | $cmid | The affected course module id. |
string | $action | The action to track for the section ('create' or 'put'). |
◆ create_or_put_section()
core_courseformat\stateupdates::create_or_put_section |
( |
int | $sectionid, |
|
|
string | $action ) |
|
protected |
Add track about section created or put.
- Parameters
-
int | $sectionid | The affected section id. |
string | $action | The action to track for the section ('create' or 'put'). |
◆ jsonSerialize()
core_courseformat\stateupdates::jsonSerialize |
( |
| ) |
|
Return the data to serialize the current track in JSON.
- Return values
-
stdClass | the statement data structure |
The documentation for this class was generated from the following file: