Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | Static Protected Member Functions | List of all members
block_starredcourses_external Class Reference

Starred courses block external functions. More...

Inheritance diagram for block_starredcourses_external:
core_course_external external_api

Static Public Member Functions

static call_external_function ($function, $args, $ajaxonly=false)
 Call an external function validating all params/returns correctly. More...
 
static check_updates ($courseid, $tocheck, $filter=array())
 Check if there is updates affecting the user for the given course and contexts. More...
 
static check_updates_parameters ()
 Returns description of method parameters. More...
 
static check_updates_returns ()
 Returns description of method result value. More...
 
static clean_returnvalue (external_description $description, $response)
 Clean response If a response attribute is unknown from the description, we just ignore the attribute. More...
 
static create_categories ($categories)
 Create categories. More...
 
static create_categories_parameters ()
 Returns description of method parameters. More...
 
static create_categories_returns ()
 Returns description of method parameters. More...
 
static create_courses ($courses)
 Create courses. More...
 
static create_courses_parameters ()
 Returns description of method parameters. More...
 
static create_courses_returns ()
 Returns description of method result value. More...
 
static delete_categories ($categories)
 Delete categories. More...
 
static delete_categories_parameters ()
 Returns description of method parameters. More...
 
static delete_categories_returns ()
 Returns description of method parameters. More...
 
static delete_courses ($courseids)
 Delete courses. More...
 
static delete_courses_parameters ()
 Returns description of method parameters. More...
 
static delete_courses_returns ()
 Returns description of method result value. More...
 
static delete_modules ($cmids)
 Deletes a list of provided module instances. More...
 
static delete_modules_parameters ()
 Describes the parameters for delete_modules. More...
 
static delete_modules_returns ()
 Describes the delete_modules return value. More...
 
static duplicate_course ($courseid, $fullname, $shortname, $categoryid, $visible=1, $options=array())
 Duplicate a course. More...
 
static duplicate_course_parameters ()
 Returns description of method parameters. More...
 
static duplicate_course_returns ()
 Returns description of method result value. More...
 
static edit_module ($action, $id, $sectionreturn=null)
 Performs one of the edit module actions and return new html for AJAX. More...
 
static edit_module_parameters ()
 Parameters for function edit_module() More...
 
static edit_module_returns ()
 Return structure for edit_module() More...
 
static edit_section ($action, $id, $sectionreturn)
 Performs one of the edit section actions. More...
 
static edit_section_parameters ()
 Parameters for function edit_section() More...
 
static edit_section_returns ()
 Return structure for edit_section() More...
 
static external_function_info ($function, $strictness=MUST_EXIST)
 Returns detailed function information. More...
 
static get_categories ($criteria=array(), $addsubcategories=true)
 Get categories. More...
 
static get_categories_parameters ()
 Returns description of method parameters. More...
 
static get_categories_returns ()
 Returns description of method result value. More...
 
static get_course_contents ($courseid, $options=array())
 Get course contents. More...
 
static get_course_contents_parameters ()
 Returns description of method parameters. More...
 
static get_course_contents_returns ()
 Returns description of method result value. More...
 
static get_course_module ($cmid)
 Return information about a course module. More...
 
static get_course_module_by_instance ($module, $instance)
 Return information about a course module. More...
 
static get_course_module_by_instance_parameters ()
 Returns description of method parameters. More...
 
static get_course_module_by_instance_returns ()
 Returns description of method result value. More...
 
static get_course_module_parameters ()
 Returns description of method parameters. More...
 
static get_course_module_returns ()
 Returns description of method result value. More...
 
static get_courses ($options=array())
 Get courses. More...
 
static get_courses_by_field ($field='', $value='')
 Get courses matching a specific field (id/s, shortname, idnumber, category) More...
 
static get_courses_by_field_parameters ()
 Returns description of method parameters. More...
 
static get_courses_by_field_returns ()
 Returns description of method result value. More...
 
static get_courses_parameters ()
 Returns description of method parameters. More...
 
static get_courses_returns ()
 Returns description of method result value. More...
 
static get_enrolled_courses_by_timeline_classification (string $classification, int $limit=0, int $offset=0, string $sort=null, string $customfieldname=null, string $customfieldvalue=null)
 Get courses matching the given timeline classification. More...
 
static get_enrolled_courses_by_timeline_classification_parameters ()
 Returns description of method parameters. More...
 
static get_enrolled_courses_by_timeline_classification_returns ()
 Returns description of method result value. More...
 
static get_enrolled_users_by_cmid (int $cmid, int $groupid=0)
 Get all users in a course for a given cmid. More...
 
static get_enrolled_users_by_cmid_parameters ()
 Returns description of method parameters. More...
 
static get_enrolled_users_by_cmid_returns ()
 Returns description of method result value. More...
 
static get_module ($id, $sectionreturn=null)
 Returns html for displaying one activity module on course page. More...
 
static get_module_parameters ()
 Parameters for function get_module() More...
 
static get_module_returns ()
 Return structure for get_module() More...
 
static get_recent_courses (int $userid=0, int $limit=0, int $offset=0, string $sort=null)
 Get last accessed courses adding additional course information like images. More...
 
static get_recent_courses_parameters ()
 Returns description of method parameters. More...
 
static get_recent_courses_returns ()
 Returns description of method result value. More...
 
static get_starred_courses ($limit, $offset)
 Get users starred courses. More...
 
static get_starred_courses_parameters ()
 Returns description of method parameters. More...
 
static get_starred_courses_returns ()
 Returns description of method result value. More...
 
static get_updates_since ($courseid, $since, $filter=array())
 Check if there are updates affecting the user for the given course since the given time stamp. More...
 
static get_updates_since_parameters ()
 Returns description of method parameters. More...
 
static get_updates_since_returns ()
 Returns description of method result value. More...
 
static get_user_administration_options ($courseids)
 Return a list of administration options in a set of courses that are available or not for the current user. More...
 
static get_user_administration_options_parameters ()
 Returns description of method parameters. More...
 
static get_user_administration_options_returns ()
 Returns description of method result value. More...
 
static get_user_navigation_options ($courseids)
 Return a list of navigation options in a set of courses that are avaialable or not for the current user. More...
 
static get_user_navigation_options_parameters ()
 Returns description of method parameters. More...
 
static get_user_navigation_options_returns ()
 Returns description of method result value. More...
 
static import_course ($importfrom, $importto, $deletecontent=0, $options=array())
 Imports a course. More...
 
static import_course_parameters ()
 Returns description of method parameters for import_course. More...
 
static import_course_returns ()
 Returns description of method result value. More...
 
static search_courses ($criterianame, $criteriavalue, $page=0, $perpage=0, $requiredcapabilities=array(), $limittoenrolled=0, $onlywithcompletion=0)
 Search courses following the specified criteria. More...
 
static search_courses_parameters ()
 Returns description of method parameters. More...
 
static search_courses_returns ()
 Returns description of method result value. More...
 
static set_context_restriction ($context)
 Set context restriction for all following subsequent function calls. More...
 
static set_favourite_courses (array $courses)
 Set the course favourite status for an array of courses. More...
 
static set_favourite_courses_parameters ()
 Returns description of method parameters. More...
 
static set_favourite_courses_returns ()
 Returns description of method result value. More...
 
static set_timeout ($seconds=360)
 This method has to be called before every operation that takes a longer time to finish! More...
 
static update_categories ($categories)
 Update categories. More...
 
static update_categories_parameters ()
 Returns description of method parameters. More...
 
static update_categories_returns ()
 Returns description of method result value. More...
 
static update_courses ($courses)
 Update courses. More...
 
static update_courses_parameters ()
 Update courses. More...
 
static update_courses_returns ()
 Returns description of method result value. More...
 
static user_description ()
 Create user return value description. More...
 
static validate_context ($context)
 Makes sure user may execute functions in this context. More...
 
static validate_parameters (external_description $description, $params)
 Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown. More...
 
static view_course ($courseid, $sectionnumber=0)
 Trigger the course viewed event. More...
 
static view_course_parameters ()
 Returns description of method parameters. More...
 
static view_course_returns ()
 Returns description of method result value. More...
 

Static Protected Member Functions

static get_context_from_params ($param)
 Get context from passed parameters. More...
 
static get_context_parameters ()
 Returns a prepared structure to use a context parameters. More...
 
static get_course_public_information (core_course_list_element $course, $coursecontext)
 Return the course information that is public (visible by every one) More...
 
static get_course_structure ($onlypublicdata=true)
 Returns a course structure definition. More...
 

Detailed Description

Starred courses block external functions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ call_external_function()

static external_api::call_external_function (   $function,
  $args,
  $ajaxonly = false 
)
staticinherited

Call an external function validating all params/returns correctly.

Note that an external function may modify the state of the current page, so this wrapper saves and restores tha PAGE and COURSE global variables before/after calling the external function.

Parameters
string$functionA webservice function name.
array$argsParams array (named params)
boolean$ajaxonlyIf true, an extra check will be peformed to see if ajax is required.
Return values
arraycontaining keys for error (bool), exception and data.

◆ check_updates()

static core_course_external::check_updates (   $courseid,
  $tocheck,
  $filter = array() 
)
staticinherited

Check if there is updates affecting the user for the given course and contexts.

Right now only modules are supported. This WS calls mod_check_updates_since for each module to check if there is any update the user should we aware of.

Parameters
int$courseidthe list of modules to check
array$tocheckthe list of modules to check
array$filtercheck only for updates in these areas
Return values
arraylist of updates and warnings
Exceptions
moodle_exception
Since
Moodle 3.2

◆ check_updates_parameters()

static core_course_external::check_updates_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ check_updates_returns()

static core_course_external::check_updates_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.2

◆ clean_returnvalue()

static external_api::clean_returnvalue ( external_description  $description,
  $response 
)
staticinherited

Clean response If a response attribute is unknown from the description, we just ignore the attribute.

If a response attribute is incorrect, invalid_response_exception is thrown. Note: this function is similar to validate parameters, however it is distinct because parameters validation must be distinct from cleaning return values.

Parameters
external_description$descriptiondescription of the return values
mixed$responsethe actual response
Return values
mixedresponse with added defaults for optional items, invalid_response_exception thrown if any problem found
Author
2010 Jerome Mouneyrac
Since
Moodle 2.0

◆ create_categories()

static core_course_external::create_categories (   $categories)
staticinherited

Create categories.

Parameters
array$categories- see create_categories_parameters() for the array structure
Return values
array- see create_categories_returns() for the array structure
Since
Moodle 2.3

◆ create_categories_parameters()

static core_course_external::create_categories_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ create_categories_returns()

static core_course_external::create_categories_returns ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ create_courses()

static core_course_external::create_courses (   $courses)
staticinherited

Create courses.

Parameters
array$courses
Return values
arraycourses (id and shortname only)
Since
Moodle 2.2

◆ create_courses_parameters()

static core_course_external::create_courses_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ create_courses_returns()

static core_course_external::create_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.2

◆ delete_categories()

static core_course_external::delete_categories (   $categories)
staticinherited

Delete categories.

Parameters
array$categoriesA list of category ids
Return values
array
Since
Moodle 2.3

◆ delete_categories_parameters()

static core_course_external::delete_categories_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ delete_categories_returns()

static core_course_external::delete_categories_returns ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ delete_courses()

static core_course_external::delete_courses (   $courseids)
staticinherited

Delete courses.

Parameters
array$courseidsA list of course ids
Since
Moodle 2.2

◆ delete_courses_parameters()

static core_course_external::delete_courses_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ delete_courses_returns()

static core_course_external::delete_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.2

◆ delete_modules()

static core_course_external::delete_modules (   $cmids)
staticinherited

Deletes a list of provided module instances.

Parameters
array$cmidsthe course module ids
Since
Moodle 2.5

◆ delete_modules_parameters()

static core_course_external::delete_modules_parameters ( )
staticinherited

Describes the parameters for delete_modules.

Return values
external_function_parameters
Since
Moodle 2.5

◆ delete_modules_returns()

static core_course_external::delete_modules_returns ( )
staticinherited

Describes the delete_modules return value.

Return values
external_single_structure
Since
Moodle 2.5

◆ duplicate_course()

static core_course_external::duplicate_course (   $courseid,
  $fullname,
  $shortname,
  $categoryid,
  $visible = 1,
  $options = array() 
)
staticinherited

Duplicate a course.

Parameters
int$courseid
string$fullnameDuplicated course fullname
string$shortnameDuplicated course shortname
int$categoryidDuplicated course parent category id
int$visibleDuplicated course availability
array$optionsList of backup options
Return values
arrayNew course info
Since
Moodle 2.3

◆ duplicate_course_parameters()

static core_course_external::duplicate_course_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ duplicate_course_returns()

static core_course_external::duplicate_course_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.3

◆ edit_module()

static core_course_external::edit_module (   $action,
  $id,
  $sectionreturn = null 
)
staticinherited

Performs one of the edit module actions and return new html for AJAX.

Returns html to replace the current module html with, for example:

  • empty string for "delete" action,
  • two modules html for "duplicate" action
  • updated module html for everything else

Throws exception if operation is not permitted/possible

Since
Moodle 3.3
Parameters
string$action
int$id
null | int$sectionreturn
Return values
string

◆ edit_module_parameters()

static core_course_external::edit_module_parameters ( )
staticinherited

Parameters for function edit_module()

Since
Moodle 3.3
Return values
external_function_parameters

◆ edit_module_returns()

static core_course_external::edit_module_returns ( )
staticinherited

Return structure for edit_module()

Since
Moodle 3.3
Return values
external_description

◆ edit_section()

static core_course_external::edit_section (   $action,
  $id,
  $sectionreturn 
)
staticinherited

Performs one of the edit section actions.

Since
Moodle 3.3
Parameters
string$action
int$idsection id
int$sectionreturnsection to return to
Return values
string

◆ edit_section_parameters()

static core_course_external::edit_section_parameters ( )
staticinherited

Parameters for function edit_section()

Since
Moodle 3.3
Return values
external_function_parameters

◆ edit_section_returns()

static core_course_external::edit_section_returns ( )
staticinherited

Return structure for edit_section()

Since
Moodle 3.3
Return values
external_description

◆ external_function_info()

static external_api::external_function_info (   $function,
  $strictness = MUST_EXIST 
)
staticinherited

Returns detailed function information.

Parameters
string | object$functionname of external function or record from external_function
int$strictnessIGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record or multiple records found
Return values
stdClassdescription or false if not found or exception thrown
Since
Moodle 2.0

◆ get_categories()

static core_course_external::get_categories (   $criteria = array(),
  $addsubcategories = true 
)
staticinherited

Get categories.

Parameters
array$criteriaCriteria to match the results
booln$addsubcategoriesobtain only the category (false) or its subcategories (true - default)
Return values
arraylist of categories
Since
Moodle 2.3

◆ get_categories_parameters()

static core_course_external::get_categories_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ get_categories_returns()

static core_course_external::get_categories_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.3

◆ get_context_from_params()

static external_api::get_context_from_params (   $param)
staticprotectedinherited

Get context from passed parameters.

The passed array must either contain a contextid or a combination of context level and instance id to fetch the context. For example, the context level can be "course" and instanceid can be courseid.

See context_helper::get_all_levels() for a list of valid context levels.

Parameters
array$param
Since
Moodle 2.6
Exceptions
invalid_parameter_exception
Return values
context

◆ get_context_parameters()

static external_api::get_context_parameters ( )
staticprotectedinherited

Returns a prepared structure to use a context parameters.

Return values
external_single_structure

Reimplemented in core_competency\external, and tool_lp\external.

◆ get_course_contents()

static core_course_external::get_course_contents (   $courseid,
  $options = array() 
)
staticinherited

Get course contents.

Parameters
int$courseidcourse id
array$optionsOptions for filtering the results, used since Moodle 2.9
Return values
array
Since
Moodle 2.9 Options available
Moodle 2.2

◆ get_course_contents_parameters()

static core_course_external::get_course_contents_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.9 Options available
Moodle 2.2

◆ get_course_contents_returns()

static core_course_external::get_course_contents_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.2

◆ get_course_module()

static core_course_external::get_course_module (   $cmid)
staticinherited

Return information about a course module.

Parameters
int$cmidthe course module id
Return values
arrayof warnings and the course module
Since
Moodle 3.0
Exceptions
moodle_exception

◆ get_course_module_by_instance()

static core_course_external::get_course_module_by_instance (   $module,
  $instance 
)
staticinherited

Return information about a course module.

Parameters
string$modulethe module name
int$instancethe activity instance id
Return values
arrayof warnings and the course module
Since
Moodle 3.0
Exceptions
moodle_exception

◆ get_course_module_by_instance_parameters()

static core_course_external::get_course_module_by_instance_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ get_course_module_by_instance_returns()

static core_course_external::get_course_module_by_instance_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.0

◆ get_course_module_parameters()

static core_course_external::get_course_module_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ get_course_module_returns()

static core_course_external::get_course_module_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.0

◆ get_course_public_information()

static core_course_external::get_course_public_information ( core_course_list_element  $course,
  $coursecontext 
)
staticprotectedinherited

Return the course information that is public (visible by every one)

Parameters
core_course_list_element$coursecourse in list object
stdClass$coursecontextcourse context object
Return values
arraythe course information
Since
Moodle 3.2

◆ get_course_structure()

static core_course_external::get_course_structure (   $onlypublicdata = true)
staticprotectedinherited

Returns a course structure definition.

Parameters
boolean$onlypublicdataset to true, to retrieve only fields viewable by anyone when the course is visible
Return values
arraythe course structure
Since
Moodle 3.2

◆ get_courses()

static core_course_external::get_courses (   $options = array())
staticinherited

Get courses.

Parameters
array$optionsIt contains an array (list of ids)
Return values
array
Since
Moodle 2.2

◆ get_courses_by_field()

static core_course_external::get_courses_by_field (   $field = '',
  $value = '' 
)
staticinherited

Get courses matching a specific field (id/s, shortname, idnumber, category)

Parameters
string$fieldfield name to search, or empty for all courses
string$valuevalue to search
Return values
arraylist of courses and warnings
Exceptions
invalid_parameter_exception
Since
Moodle 3.2

◆ get_courses_by_field_parameters()

static core_course_external::get_courses_by_field_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ get_courses_by_field_returns()

static core_course_external::get_courses_by_field_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.2

◆ get_courses_parameters()

static core_course_external::get_courses_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ get_courses_returns()

static core_course_external::get_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.2

◆ get_enrolled_courses_by_timeline_classification()

static core_course_external::get_enrolled_courses_by_timeline_classification ( string  $classification,
int  $limit = 0,
int  $offset = 0,
string  $sort = null,
string  $customfieldname = null,
string  $customfieldvalue = null 
)
staticinherited

Get courses matching the given timeline classification.

NOTE: The offset applies to the unfiltered full set of courses before the classification filtering is done. E.g. If the user is enrolled in 5 courses: c1, c2, c3, c4, and c5 And c4 and c5 are 'future' courses

If a request comes in for future courses with an offset of 1 it will mean that c1 is skipped (because the offset applies before the classification filtering) and c4 and c5 will be return.

Parameters
string$classificationpast, inprogress, or future
int$limitResult set limit
int$offsetOffset the full course set before timeline classification is applied
string$sortSQL sort string for results
string$customfieldname
string$customfieldvalue
Return values
arraylist of courses and warnings
Exceptions
invalid_parameter_exception

◆ get_enrolled_courses_by_timeline_classification_parameters()

static core_course_external::get_enrolled_courses_by_timeline_classification_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters

◆ get_enrolled_courses_by_timeline_classification_returns()

static core_course_external::get_enrolled_courses_by_timeline_classification_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description

◆ get_enrolled_users_by_cmid()

static core_course_external::get_enrolled_users_by_cmid ( int  $cmid,
int  $groupid = 0 
)
staticinherited

Get all users in a course for a given cmid.

Parameters
int$cmidCourse Module id from which the users will be obtained
int$groupidGroup id from which the users will be obtained
Return values
arrayList of users
Exceptions
invalid_parameter_exception

◆ get_enrolled_users_by_cmid_parameters()

static core_course_external::get_enrolled_users_by_cmid_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters

◆ get_enrolled_users_by_cmid_returns()

static core_course_external::get_enrolled_users_by_cmid_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description

◆ get_module()

static core_course_external::get_module (   $id,
  $sectionreturn = null 
)
staticinherited

Returns html for displaying one activity module on course page.

Since
Moodle 3.3
Parameters
int$id
null | int$sectionreturn
Return values
string

◆ get_module_parameters()

static core_course_external::get_module_parameters ( )
staticinherited

Parameters for function get_module()

Since
Moodle 3.3
Return values
external_function_parameters

◆ get_module_returns()

static core_course_external::get_module_returns ( )
staticinherited

Return structure for get_module()

Since
Moodle 3.3
Return values
external_description

◆ get_recent_courses()

static core_course_external::get_recent_courses ( int  $userid = 0,
int  $limit = 0,
int  $offset = 0,
string  $sort = null 
)
staticinherited

Get last accessed courses adding additional course information like images.

Parameters
int$useridUser id from which the courses will be obtained
int$limitRestrict result set to this amount
int$offsetSkip this number of records from the start of the result set
string | null$sortSQL string for sorting
Return values
arrayList of courses
Exceptions
invalid_parameter_exception

◆ get_recent_courses_parameters()

static core_course_external::get_recent_courses_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.6

◆ get_recent_courses_returns()

static core_course_external::get_recent_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.6

◆ get_starred_courses()

static block_starredcourses_external::get_starred_courses (   $limit,
  $offset 
)
static

Get users starred courses.

Parameters
int$limitLimit
int$offsetOffset
Return values
arraylist of courses and warnings

◆ get_starred_courses_parameters()

static block_starredcourses_external::get_starred_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.6

◆ get_starred_courses_returns()

static block_starredcourses_external::get_starred_courses_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.6

◆ get_updates_since()

static core_course_external::get_updates_since (   $courseid,
  $since,
  $filter = array() 
)
staticinherited

Check if there are updates affecting the user for the given course since the given time stamp.

This function is a wrapper of self::check_updates for retrieving all the updates since a given time for all the activities.

Parameters
int$courseidthe list of modules to check
int$sincecheck updates since this time stamp
array$filtercheck only for updates in these areas
Return values
arraylist of updates and warnings
Exceptions
moodle_exception
Since
Moodle 3.3

◆ get_updates_since_parameters()

static core_course_external::get_updates_since_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ get_updates_since_returns()

static core_course_external::get_updates_since_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.3

◆ get_user_administration_options()

static core_course_external::get_user_administration_options (   $courseids)
staticinherited

Return a list of administration options in a set of courses that are available or not for the current user.

Parameters
array$courseidsa list of course ids
Return values
arrayof warnings and the options availability
Since
Moodle 3.2
Exceptions
moodle_exception

◆ get_user_administration_options_parameters()

static core_course_external::get_user_administration_options_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ get_user_administration_options_returns()

static core_course_external::get_user_administration_options_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.2

◆ get_user_navigation_options()

static core_course_external::get_user_navigation_options (   $courseids)
staticinherited

Return a list of navigation options in a set of courses that are avaialable or not for the current user.

Parameters
array$courseidsa list of course ids
Return values
arrayof warnings and the options availability
Since
Moodle 3.2
Exceptions
moodle_exception

◆ get_user_navigation_options_parameters()

static core_course_external::get_user_navigation_options_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ get_user_navigation_options_returns()

static core_course_external::get_user_navigation_options_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.2

◆ import_course()

static core_course_external::import_course (   $importfrom,
  $importto,
  $deletecontent = 0,
  $options = array() 
)
staticinherited

Imports a course.

Parameters
int$importfromThe id of the course we are importing from
int$importtoThe id of the course we are importing to
bool$deletecontentWhether to delete the course we are importing to content
array$optionsList of backup options
Return values
null
Since
Moodle 2.4

◆ import_course_parameters()

static core_course_external::import_course_parameters ( )
staticinherited

Returns description of method parameters for import_course.

Return values
external_function_parameters
Since
Moodle 2.4

◆ import_course_returns()

static core_course_external::import_course_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.4

◆ search_courses()

static core_course_external::search_courses (   $criterianame,
  $criteriavalue,
  $page = 0,
  $perpage = 0,
  $requiredcapabilities = array(),
  $limittoenrolled = 0,
  $onlywithcompletion = 0 
)
staticinherited

Search courses following the specified criteria.

Parameters
string$criterianameCriteria name (search, modulelist (only admins), blocklist (only admins), tagid)
string$criteriavalueCriteria value
int$pagePage number (for pagination)
int$perpageItems per page
array$requiredcapabilitiesOptional list of required capabilities (used to filter the list).
int$limittoenrolledLimit to only enrolled courses
intonlywithcompletion Limit to only courses where completion is enabled
Return values
arrayof course objects and warnings
Since
Moodle 3.0
Exceptions
moodle_exception

◆ search_courses_parameters()

static core_course_external::search_courses_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ search_courses_returns()

static core_course_external::search_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 3.0

◆ set_context_restriction()

static external_api::set_context_restriction (   $context)
staticinherited

Set context restriction for all following subsequent function calls.

Parameters
stdClass$contextthe context restriction
Since
Moodle 2.0

◆ set_favourite_courses()

static core_course_external::set_favourite_courses ( array  $courses)
staticinherited

Set the course favourite status for an array of courses.

Parameters
array$coursesList with course id's and favourite status.
Return values
arrayArray with an array of favourite courses.

◆ set_favourite_courses_parameters()

static core_course_external::set_favourite_courses_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters

◆ set_favourite_courses_returns()

static core_course_external::set_favourite_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description

◆ set_timeout()

static external_api::set_timeout (   $seconds = 360)
staticinherited

This method has to be called before every operation that takes a longer time to finish!

Parameters
int$secondsmax expected time the next operation needs
Since
Moodle 2.0

◆ update_categories()

static core_course_external::update_categories (   $categories)
staticinherited

Update categories.

Parameters
array$categoriesThe list of categories to update
Return values
null
Since
Moodle 2.3

◆ update_categories_parameters()

static core_course_external::update_categories_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ update_categories_returns()

static core_course_external::update_categories_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.3

◆ update_courses()

static core_course_external::update_courses (   $courses)
staticinherited

Update courses.

Parameters
array$courses
Since
Moodle 2.5

◆ update_courses_parameters()

static core_course_external::update_courses_parameters ( )
staticinherited

Update courses.

Return values
external_function_parameters
Since
Moodle 2.5

◆ update_courses_returns()

static core_course_external::update_courses_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.5

◆ user_description()

static core_course_external::user_description ( )
staticinherited

Create user return value description.

Return values
external_description

◆ validate_context()

static external_api::validate_context (   $context)
staticinherited

Makes sure user may execute functions in this context.

Parameters
stdClass$context
Since
Moodle 2.0

◆ validate_parameters()

static external_api::validate_parameters ( external_description  $description,
  $params 
)
staticinherited

Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown.

This is a simple recursive method which is intended to be called from each implementation method of external API.

Parameters
external_description$descriptiondescription of parameters
mixed$paramsthe actual parameters
Return values
mixedparams with added defaults for optional items, invalid_parameters_exception thrown if any problem found
Since
Moodle 2.0

◆ view_course()

static core_course_external::view_course (   $courseid,
  $sectionnumber = 0 
)
staticinherited

Trigger the course viewed event.

Parameters
int$courseidid of course
int$sectionnumbersectionnumber (0, 1, 2...)
Return values
arrayof warnings and status result
Since
Moodle 2.9
Exceptions
moodle_exception

◆ view_course_parameters()

static core_course_external::view_course_parameters ( )
staticinherited

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.9

◆ view_course_returns()

static core_course_external::view_course_returns ( )
staticinherited

Returns description of method result value.

Return values
external_description
Since
Moodle 2.9

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