Utility functions for the external API.
More...
|
static | get_area_files ($contextid, $component, $filearea, $itemid=false, $useitemidinurl=true) |
| Returns all area files (optionally limited by itemid). More...
|
|
static | validate_courses ($courseids, $courses=array(), $addcontext=false, $keepfails=false) |
| Validate a list of courses, returning the complete course objects for valid courses. More...
|
|
Utility functions for the external API.
- Copyright
- 2015 Juan Leyva
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- Since
- Moodle 3.0
◆ get_area_files()
static external_util::get_area_files |
( |
|
$contextid, |
|
|
|
$component, |
|
|
|
$filearea, |
|
|
|
$itemid = false , |
|
|
|
$useitemidinurl = true |
|
) |
| |
|
static |
Returns all area files (optionally limited by itemid).
- Parameters
-
int | $contextid | context ID |
string | $component | component |
string | $filearea | file area |
int | $itemid | item ID or all files if not specified |
bool | $useitemidinurl | wether to use the item id in the file URL (modules intro don't use it) |
- Return values
-
- Since
- Moodle 3.2
◆ validate_courses()
static external_util::validate_courses |
( |
|
$courseids, |
|
|
|
$courses = array() , |
|
|
|
$addcontext = false , |
|
|
|
$keepfails = false |
|
) |
| |
|
static |
Validate a list of courses, returning the complete course objects for valid courses.
Each course has an additional 'contextvalidated' field, this will be set to true unless you set $keepfails, in which case it will be false if validation fails for a course.
- Parameters
-
array | $courseids | A list of course ids |
array | $courses | An array of courses already pre-fetched, indexed by course id. |
bool | $addcontext | True if the returned course object should include the full context object. |
bool | $keepfails | True to keep all the course objects even if validation fails |
- Return values
-
array | An array of courses and the validation warnings |
The documentation for this class was generated from the following file: