Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_course\external\helper_for_get_mods_by_courses Class Reference

Static Public Member Functions

static format_name_and_intro (\stdClass $modinstance, string $component)
 Format the module name an introduction ready to be exported to a web service.
 
static standard_coursemodule_element_values (\stdClass $modinstance, string $component, string $capabilityforgroups='moodle/course:manageactivities', string $capabilityforintro=null)
 Add the value of all the standard fields to the results to be returned by the service.
 
static standard_coursemodule_elements_returns (bool $introoptional=false)
 Get the list of standard fields, to add to the declaration of the return values.
 

Member Function Documentation

◆ format_name_and_intro()

static core_course\external\helper_for_get_mods_by_courses::format_name_and_intro ( \stdClass $modinstance,
string $component )
static

Format the module name an introduction ready to be exported to a web service.

Note that $modinstance is updated in-place.

Parameters
stdClass$modinstanceone of the objects returned from a call to {
See also
get_all_instances_in_courses()}.
Parameters
string$componentthe plugin name, e.g. 'mod_book'.

◆ standard_coursemodule_element_values()

static core_course\external\helper_for_get_mods_by_courses::standard_coursemodule_element_values ( \stdClass $modinstance,
string $component,
string $capabilityforgroups = 'moodle/course:manageactivities',
string $capabilityforintro = null )
static

Add the value of all the standard fields to the results to be returned by the service.

This is designed to be used in the implementation of the get_..._by_courses web service methods.

Note that $modinstance is also updated in-place.

Parameters
stdClass$modinstanceone of the objects returned from a call to {
See also
get_all_instances_in_courses()}.
Parameters
string$componentthe plugin name, e.g. 'mod_book'.
string$capabilityforgroupscapability to check before including group/visible/section info in the results.
string | null$capabilityforintrocapability to check before including intro info in the results. null means always include (the default).
Return values
arraywith the containing all the values declared in {
See also
standard_coursemodule_elements_returns()}.

◆ standard_coursemodule_elements_returns()

static core_course\external\helper_for_get_mods_by_courses::standard_coursemodule_elements_returns ( bool $introoptional = false)
static

Get the list of standard fields, to add to the declaration of the return values.

Example usage combine the fields returned here with any extra ones your activity uses:

public static function execute_returns() { return new external_single_structure([ 'bigbluebuttonbns' => new external_multiple_structure( new external_single_structure(array_merge( helper_for_get_mods_by_courses\standard_coursemodule_elements_returns(), [ 'meetingid' => new external_value(PARAM_RAW, 'Meeting id'), 'timemodified' => new external_value(PARAM_INT, 'Last time the instance was modified'), ] )) ), 'warnings' => new external_warnings(), ] ); }

Parameters
bool$introoptionalif true, the intro fields are marked as optional. Default false.
Return values
external_description[]array of standard fields, to which you can add your activity-specific ones.

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