Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | Static Protected Member Functions | List of all members
tool_lp\external Class Reference

This is the external API for this tool. More...

Inheritance diagram for tool_lp\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 clean_returnvalue (external_description $description, $response)
 Clean response If a response attribute is unknown from the description, we just ignore the attribute. More...
 
static data_for_competencies_manage_page ($competencyframeworkid, $search)
 Loads the data required to render the competencies_manage_page template. More...
 
static data_for_competencies_manage_page_parameters ()
 Returns description of data_for_competencies_manage_page() parameters. More...
 
static data_for_competencies_manage_page_returns ()
 Returns description of data_for_competencies_manage_page() result value. More...
 
static data_for_competency_frameworks_manage_page ($pagecontext)
 Loads the data required to render the competency_frameworks_manage_page template. More...
 
static data_for_competency_frameworks_manage_page_parameters ()
 Returns description of data_for_competency_frameworks_manage_page() parameters. More...
 
static data_for_competency_frameworks_manage_page_returns ()
 Returns description of data_for_competency_frameworks_manage_page() result value. More...
 
static data_for_competency_summary ($competencyid, $includerelated=false, $includecourses=false)
 Loads the data required to render the competency_page template. More...
 
static data_for_competency_summary_parameters ()
 Returns description of data_for_competency_summary() parameters. More...
 
static data_for_competency_summary_returns ()
 Returns description of data_for_competency_summary_() result value. More...
 
static data_for_course_competencies_page ($courseid, $moduleid)
 Loads the data required to render the course_competencies_page template. More...
 
static data_for_course_competencies_page_parameters ()
 Returns description of data_for_course_competenies_page() parameters. More...
 
static data_for_course_competencies_page_returns ()
 Returns description of data_for_course_competencies_page() result value. More...
 
static data_for_plan_page ($planid)
 Loads the data required to render the plan_page template. More...
 
static data_for_plan_page_parameters ()
 Returns description of data_for_plan_competenies_page() parameters. More...
 
static data_for_plan_page_returns ()
 Returns description of data_for_plan_page() result value. More...
 
static data_for_plans_page ($userid)
 Loads the data required to render the plans_page template. More...
 
static data_for_plans_page_parameters ()
 Returns description of data_for_plans_page() parameters. More...
 
static data_for_plans_page_returns ()
 Returns description of data_for_plans_page() result value. More...
 
static data_for_related_competencies_section ($competencyid)
 Data to render in the related competencies section. More...
 
static data_for_related_competencies_section_parameters ()
 Returns the description of the data_for_related_competencies_section_parameters() parameters. More...
 
static data_for_related_competencies_section_returns ()
 Returns description of data_for_related_competencies_section_returns() result value. More...
 
static data_for_template_competencies_page ($templateid, $pagecontext)
 Loads the data required to render the template_competencies_page template. More...
 
static data_for_template_competencies_page_parameters ()
 Returns description of data_for_template_competenies_page() parameters. More...
 
static data_for_template_competencies_page_returns ()
 Returns description of data_for_template_competencies_page() result value. More...
 
static data_for_templates_manage_page ($pagecontext)
 Loads the data required to render the templates_manage_page template. More...
 
static data_for_templates_manage_page_parameters ()
 Returns description of data_for_templates_manage_page() parameters. More...
 
static data_for_templates_manage_page_returns ()
 Returns description of data_for_templates_manage_page() result value. More...
 
static data_for_user_competency_summary ($userid, $competencyid)
 Data for user competency summary. More...
 
static data_for_user_competency_summary_in_course ($userid, $competencyid, $courseid)
 Read a user competency summary. More...
 
static data_for_user_competency_summary_in_course_parameters ()
 Returns description of data_for_user_competency_summary_in_course() parameters. More...
 
static data_for_user_competency_summary_in_course_returns ()
 Returns description of data_for_user_competency_summary_in_course() result value. More...
 
static data_for_user_competency_summary_in_plan ($competencyid, $planid)
 Read a user competency summary. More...
 
static data_for_user_competency_summary_in_plan_parameters ()
 Returns description of data_for_user_competency_summary_in_plan() parameters. More...
 
static data_for_user_competency_summary_in_plan_returns ()
 Returns description of data_for_user_competency_summary_in_plan() result value. More...
 
static data_for_user_competency_summary_parameters ()
 Returns description of external function. More...
 
static data_for_user_competency_summary_returns ()
 Returns description of external function. More...
 
static data_for_user_evidence_list_page ($userid)
 Loads the data required to render the user_evidence_list_page template. More...
 
static data_for_user_evidence_list_page_parameters ()
 Returns description of external function parameters. More...
 
static data_for_user_evidence_list_page_returns ()
 Returns description of external function result value. More...
 
static data_for_user_evidence_page ($id)
 Loads the data required to render the user_evidence_page template. More...
 
static data_for_user_evidence_page_parameters ()
 Returns description of external function parameters. More...
 
static data_for_user_evidence_page_returns ()
 Returns description of external function result value. More...
 
static external_function_info ($function, $strictness=MUST_EXIST)
 Returns detailed function information. More...
 
static list_courses_using_competency ($competencyid)
 Count the courses (visible to this user) that use this competency. More...
 
static list_courses_using_competency_parameters ()
 Returns description of list_courses_using_competency() parameters. More...
 
static list_courses_using_competency_returns ()
 Returns description of list_courses_using_competency() result value. More...
 
static search_users ($query, $capability='', $limitfrom=0, $limitnum=100)
 Search users. More...
 
static search_users_parameters ()
 Returns the description of external function parameters. More...
 
static search_users_returns ()
 Returns description of external function result value. More...
 
static set_context_restriction ($context)
 Set context restriction for all following subsequent function calls. More...
 
static set_timeout ($seconds=360)
 This method has to be called before every operation that takes a longer time to finish! 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 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...
 

Detailed Description

This is the external API for this tool.

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.

◆ 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

◆ data_for_competencies_manage_page()

static tool_lp\external::data_for_competencies_manage_page (   $competencyframeworkid,
  $search 
)
static

Loads the data required to render the competencies_manage_page template.

Parameters
int$competencyframeworkidFramework id.
string$searchText to search.
Return values
boolean

◆ data_for_competencies_manage_page_parameters()

static tool_lp\external::data_for_competencies_manage_page_parameters ( )
static

Returns description of data_for_competencies_manage_page() parameters.

Return values
external_function_parameters

◆ data_for_competencies_manage_page_returns()

static tool_lp\external::data_for_competencies_manage_page_returns ( )
static

Returns description of data_for_competencies_manage_page() result value.

Return values
external_description

◆ data_for_competency_frameworks_manage_page()

static tool_lp\external::data_for_competency_frameworks_manage_page (   $pagecontext)
static

Loads the data required to render the competency_frameworks_manage_page template.

Parameters
context$pagecontextThe page context
Return values
stdClass

◆ data_for_competency_frameworks_manage_page_parameters()

static tool_lp\external::data_for_competency_frameworks_manage_page_parameters ( )
static

Returns description of data_for_competency_frameworks_manage_page() parameters.

Return values
external_function_parameters

◆ data_for_competency_frameworks_manage_page_returns()

static tool_lp\external::data_for_competency_frameworks_manage_page_returns ( )
static

Returns description of data_for_competency_frameworks_manage_page() result value.

Return values
external_description

◆ data_for_competency_summary()

static tool_lp\external::data_for_competency_summary (   $competencyid,
  $includerelated = false,
  $includecourses = false 
)
static

Loads the data required to render the competency_page template.

Parameters
int$competencyidCompetency id.
boolean$includerelatedInclude or not related competencies.
boolean$includecoursesInclude or not competency courses.
Return values
stdClass

◆ data_for_competency_summary_parameters()

static tool_lp\external::data_for_competency_summary_parameters ( )
static

Returns description of data_for_competency_summary() parameters.

Return values
external_function_parameters

◆ data_for_competency_summary_returns()

static tool_lp\external::data_for_competency_summary_returns ( )
static

Returns description of data_for_competency_summary_() result value.

Return values
external_description

◆ data_for_course_competencies_page()

static tool_lp\external::data_for_course_competencies_page (   $courseid,
  $moduleid 
)
static

Loads the data required to render the course_competencies_page template.

Parameters
int$courseidThe course id to check.
int$moduleidThe module id to check (0 for no filter).
Return values
boolean

◆ data_for_course_competencies_page_parameters()

static tool_lp\external::data_for_course_competencies_page_parameters ( )
static

Returns description of data_for_course_competenies_page() parameters.

Return values
external_function_parameters

◆ data_for_course_competencies_page_returns()

static tool_lp\external::data_for_course_competencies_page_returns ( )
static

Returns description of data_for_course_competencies_page() result value.

Return values
external_description

◆ data_for_plan_page()

static tool_lp\external::data_for_plan_page (   $planid)
static

Loads the data required to render the plan_page template.

Parameters
int$planidLearning Plan id.
Return values
boolean

◆ data_for_plan_page_parameters()

static tool_lp\external::data_for_plan_page_parameters ( )
static

Returns description of data_for_plan_competenies_page() parameters.

Return values
external_function_parameters

◆ data_for_plan_page_returns()

static tool_lp\external::data_for_plan_page_returns ( )
static

Returns description of data_for_plan_page() result value.

Return values
external_description

◆ data_for_plans_page()

static tool_lp\external::data_for_plans_page (   $userid)
static

Loads the data required to render the plans_page template.

Parameters
int$useridUser id.
Return values
boolean

◆ data_for_plans_page_parameters()

static tool_lp\external::data_for_plans_page_parameters ( )
static

Returns description of data_for_plans_page() parameters.

Return values
external_function_parameters

◆ data_for_plans_page_returns()

static tool_lp\external::data_for_plans_page_returns ( )
static

Returns description of data_for_plans_page() result value.

Return values
external_description

◆ data_for_related_competencies_section()

static tool_lp\external::data_for_related_competencies_section (   $competencyid)
static

Data to render in the related competencies section.

Parameters
int$competencyid
Return values
arrayRelated competencies and whether to show delete action button or not.

◆ data_for_related_competencies_section_parameters()

static tool_lp\external::data_for_related_competencies_section_parameters ( )
static

Returns the description of the data_for_related_competencies_section_parameters() parameters.

Return values
external_function_parameters.

◆ data_for_related_competencies_section_returns()

static tool_lp\external::data_for_related_competencies_section_returns ( )
static

Returns description of data_for_related_competencies_section_returns() result value.

Return values
external_description

◆ data_for_template_competencies_page()

static tool_lp\external::data_for_template_competencies_page (   $templateid,
  $pagecontext 
)
static

Loads the data required to render the template_competencies_page template.

Parameters
int$templateidTemplate id.
array$pagecontextThe page context info.
Return values
boolean

◆ data_for_template_competencies_page_parameters()

static tool_lp\external::data_for_template_competencies_page_parameters ( )
static

Returns description of data_for_template_competenies_page() parameters.

Return values
external_function_parameters

◆ data_for_template_competencies_page_returns()

static tool_lp\external::data_for_template_competencies_page_returns ( )
static

Returns description of data_for_template_competencies_page() result value.

Return values
external_description

◆ data_for_templates_manage_page()

static tool_lp\external::data_for_templates_manage_page (   $pagecontext)
static

Loads the data required to render the templates_manage_page template.

Parameters
array$pagecontextThe page context info.
Return values
boolean

◆ data_for_templates_manage_page_parameters()

static tool_lp\external::data_for_templates_manage_page_parameters ( )
static

Returns description of data_for_templates_manage_page() parameters.

Return values
external_function_parameters

◆ data_for_templates_manage_page_returns()

static tool_lp\external::data_for_templates_manage_page_returns ( )
static

Returns description of data_for_templates_manage_page() result value.

Return values
external_description

◆ data_for_user_competency_summary()

static tool_lp\external::data_for_user_competency_summary (   $userid,
  $competencyid 
)
static

Data for user competency summary.

Parameters
int$useridThe user ID
int$competencyidThe competency ID
Return values
stdClass

◆ data_for_user_competency_summary_in_course()

static tool_lp\external::data_for_user_competency_summary_in_course (   $userid,
  $competencyid,
  $courseid 
)
static

Read a user competency summary.

Parameters
int$useridThe user id
int$competencyidThe competency id
int$courseidThe course id
Return values
stdClass

◆ data_for_user_competency_summary_in_course_parameters()

static tool_lp\external::data_for_user_competency_summary_in_course_parameters ( )
static

Returns description of data_for_user_competency_summary_in_course() parameters.

Return values
external_function_parameters

◆ data_for_user_competency_summary_in_course_returns()

static tool_lp\external::data_for_user_competency_summary_in_course_returns ( )
static

Returns description of data_for_user_competency_summary_in_course() result value.

Return values
external_description

◆ data_for_user_competency_summary_in_plan()

static tool_lp\external::data_for_user_competency_summary_in_plan (   $competencyid,
  $planid 
)
static

Read a user competency summary.

Parameters
int$competencyidThe competency id
int$planidThe plan id
Return values
stdClass

◆ data_for_user_competency_summary_in_plan_parameters()

static tool_lp\external::data_for_user_competency_summary_in_plan_parameters ( )
static

Returns description of data_for_user_competency_summary_in_plan() parameters.

Return values
external_function_parameters

◆ data_for_user_competency_summary_in_plan_returns()

static tool_lp\external::data_for_user_competency_summary_in_plan_returns ( )
static

Returns description of data_for_user_competency_summary_in_plan() result value.

Return values
external_description

◆ data_for_user_competency_summary_parameters()

static tool_lp\external::data_for_user_competency_summary_parameters ( )
static

Returns description of external function.

Return values
external_function_parameters

◆ data_for_user_competency_summary_returns()

static tool_lp\external::data_for_user_competency_summary_returns ( )
static

Returns description of external function.

Return values
external_description

◆ data_for_user_evidence_list_page()

static tool_lp\external::data_for_user_evidence_list_page (   $userid)
static

Loads the data required to render the user_evidence_list_page template.

Parameters
int$useridUser id.
Return values
boolean

◆ data_for_user_evidence_list_page_parameters()

static tool_lp\external::data_for_user_evidence_list_page_parameters ( )
static

Returns description of external function parameters.

Return values
external_function_parameters

◆ data_for_user_evidence_list_page_returns()

static tool_lp\external::data_for_user_evidence_list_page_returns ( )
static

Returns description of external function result value.

Return values
external_description

◆ data_for_user_evidence_page()

static tool_lp\external::data_for_user_evidence_page (   $id)
static

Loads the data required to render the user_evidence_page template.

Parameters
int$idUser id.
Return values
boolean

◆ data_for_user_evidence_page_parameters()

static tool_lp\external::data_for_user_evidence_page_parameters ( )
static

Returns description of external function parameters.

Return values
external_function_parameters

◆ data_for_user_evidence_page_returns()

static tool_lp\external::data_for_user_evidence_page_returns ( )
static

Returns description of external function result value.

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_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 tool_lp\external::get_context_parameters ( )
staticprotected

Returns a prepared structure to use a context parameters.

Return values
external_single_structure

Reimplemented from external_api.

◆ list_courses_using_competency()

static tool_lp\external::list_courses_using_competency (   $competencyid)
static

Count the courses (visible to this user) that use this competency.

Parameters
int$competencyidCompetency id.
Return values
array

◆ list_courses_using_competency_parameters()

static tool_lp\external::list_courses_using_competency_parameters ( )
static

Returns description of list_courses_using_competency() parameters.

Return values
external_function_parameters

◆ list_courses_using_competency_returns()

static tool_lp\external::list_courses_using_competency_returns ( )
static

Returns description of list_courses_using_competency() result value.

Return values
external_description

◆ search_users()

static tool_lp\external::search_users (   $query,
  $capability = '',
  $limitfrom = 0,
  $limitnum = 100 
)
static

Search users.

Parameters
string$query
string$capability
int$limitfrom
int$limitnum
Return values
array

◆ search_users_parameters()

static tool_lp\external::search_users_parameters ( )
static

Returns the description of external function parameters.

Return values
external_function_parameters.

◆ search_users_returns()

static tool_lp\external::search_users_returns ( )
static

Returns description of external function result value.

Return values
external_description

◆ 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_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

◆ 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

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