Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
core_courseformat\local\cmactions Class Reference
Inheritance diagram for core_courseformat\local\cmactions:
core_courseformat\local\baseactions

Public Member Functions

 rename (int $cmid, string $name)
 Rename a course module.
 
 set_visibility (int $cmid, int $visible, int $visibleoncoursepage=1, bool $rebuildcache=true)
 Update a course module.
 

Protected Member Functions

 get_cm_info ($cmid)
 Get the cm info.
 
 get_course ()
 Get the course.
 
 get_format ()
 Get the course format.
 
 get_section_info ($sectionid, int $strictness=IGNORE_MISSING)
 Get the section info.
 
 update_delegated (stdClass $cm, array $sectionfields, bool $rebuildcache=true)
 Update a course delegated section linked to the given module.
 

Protected Attributes

stdClass stdClass $course
 the course object.
 

Member Function Documentation

◆ get_cm_info()

core_courseformat\local\baseactions::get_cm_info ( $cmid)
protectedinherited

Get the cm info.

Parameters
int$cmidthe cm id.
Return values
cm_info|nullInformation for numbered cm or null if not found

◆ get_course()

core_courseformat\local\baseactions::get_course ( )
protectedinherited

Get the course.

Return values
stdClassthe course object.

◆ get_format()

core_courseformat\local\baseactions::get_format ( )
protectedinherited

Get the course format.

Return values
course_formatthe course format.

◆ get_section_info()

core_courseformat\local\baseactions::get_section_info ( $sectionid,
int $strictness = IGNORE_MISSING )
protectedinherited

Get the section info.

Parameters
int$sectionidthe section id.
int$strictnessUse MUST_EXIST to throw exception if it doesn't
Return values
section_info|nullInformation for numbered section or null if not found

◆ rename()

core_courseformat\local\cmactions::rename ( int $cmid,
string $name )

Rename a course module.

Parameters
int$cmidthe course module id.
string$namethe new name.
Return values
booltrue if the course module was renamed, false otherwise.

◆ set_visibility()

core_courseformat\local\cmactions::set_visibility ( int $cmid,
int $visible,
int $visibleoncoursepage = 1,
bool $rebuildcache = true )

Update a course module.

Parameters
int$cmidthe course module id.
int$visiblestate of the module
int$visibleoncoursepagestate of the module on the course page
bool$rebuildcacheIf true (default), perform a partial cache purge and rebuild.
Return values
boolwhether course module was updated

◆ update_delegated()

core_courseformat\local\cmactions::update_delegated ( stdClass $cm,
array $sectionfields,
bool $rebuildcache = true )
protected

Update a course delegated section linked to the given module.

Parameters
stdClass$cm
array$sectionfieldsto change in section database record.
bool$rebuildcacheIf true (default), perform a partial cache purge and rebuild.
Return values
booltrue if any delegated section has been updated, false otherwise.

The documentation for this class was generated from the following file: