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

Class for exporting a course summary from an stdClass. More...

Inheritance diagram for core_course\external\course_summary_exporter:

Public Member Functions

 __construct ($data, $related=array())
 Constructor - saves the persistent object, and the related objects.
 

Static Public Member Functions

static coursecolor ($courseid)
 Get the course color.
 
static define_other_properties ()
 
static define_properties ()
 
static get_course_image ($course)
 Get the course image if added to course.
 
static get_course_pattern ($course)
 Get the course pattern datauri.
 
static get_course_progress ($course)
 Get the course progress percentage.
 

Protected Member Functions

 get_format_parameters_for_summary ()
 Get the formatting parameters for the summary.
 
 get_other_values (renderer_base $output)
 

Static Protected Member Functions

static define_related ()
 

Detailed Description

Class for exporting a course summary from an stdClass.

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

Constructor & Destructor Documentation

◆ __construct()

core_course\external\course_summary_exporter::__construct ( $data,
$related = array() )

Constructor - saves the persistent object, and the related objects.

Parameters
mixed$data- Either an stdClass or an array of values.
array$related- An optional list of pre-loaded objects related to this object.

Member Function Documentation

◆ coursecolor()

static core_course\external\course_summary_exporter::coursecolor ( $courseid)
static

Get the course color.

Parameters
int$courseid
Return values
stringhex color code.
Deprecated
3.7

◆ get_course_image()

static core_course\external\course_summary_exporter::get_course_image ( $course)
static

Get the course image if added to course.

Parameters
object$course
Return values
string|falseurl of course image or false if it's not exist.

◆ get_course_pattern()

static core_course\external\course_summary_exporter::get_course_pattern ( $course)
static

Get the course pattern datauri.

The datauri is an encoded svg that can be passed as a url.

Parameters
object$course
Return values
stringdatauri
Deprecated
3.7

◆ get_course_progress()

static core_course\external\course_summary_exporter::get_course_progress ( $course)
static

Get the course progress percentage.

Parameters
object$course
Return values
intprogress

◆ get_format_parameters_for_summary()

core_course\external\course_summary_exporter::get_format_parameters_for_summary ( )
protected

Get the formatting parameters for the summary.

Return values
array

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