Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Attributes | List of all members
file_browser Class Reference

Public Member Functions

 get_file_info ($context=NULL, $component=NULL, $filearea=NULL, $itemid=NULL, $filepath=NULL, $filename=NULL)
 Looks up file_info instance. More...
 
 is_enrolled ($courseid)
 Check if user is enrolled into the course. More...
 

Protected Attributes

array $enrolledcourses = null
 cached list of enrolled courses. More...
 

Member Function Documentation

◆ get_file_info()

file_browser::get_file_info (   $context = NULL,
  $component = NULL,
  $filearea = NULL,
  $itemid = NULL,
  $filepath = NULL,
  $filename = NULL 
)

Looks up file_info instance.

Parameters
stdClass$contextcontext object
string$componentcomponent
string$fileareafile area
int$itemiditem ID
string$filepathfile path
string$filenamefile name
Return values
file_info|nullfile_info instance or null if not found or access not allowed

◆ is_enrolled()

file_browser::is_enrolled (   $courseid)

Check if user is enrolled into the course.

This function keeps a cache of enrolled courses because it may be called multiple times for many courses in one request

Parameters
int$courseid
Return values
bool

Member Data Documentation

◆ $enrolledcourses

array file_browser::$enrolledcourses = null
protected

cached list of enrolled courses.



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