Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
core_course\cache\course_image Class Reference

Class to describe cache data source for course image. More...

Inheritance diagram for core_course\cache\course_image:

Public Member Functions

 load_for_cache ($key)
 Loads the data for the key provided ready formatted for caching.
 
 load_many_for_cache (array $keys)
 Loads several keys for the cache.
 

Static Public Member Functions

static get_instance_for_cache (cache_definition $definition)
 Returns an instance of the data source class that the cache can use for loading data using the other methods specified by this interface.
 

Protected Member Functions

 get_image_url_from_overview_files (\stdClass $course)
 Returns image URL from course overview files.
 

Static Protected Attributes

static course_image $instance = null
 

Detailed Description

Class to describe cache data source for course image.

Author
Dmitrii Metelkin dmitr.nosp@m.iim@.nosp@m.catal.nosp@m.yst-.nosp@m.au.ne.nosp@m.t
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_image_url_from_overview_files()

core_course\cache\course_image::get_image_url_from_overview_files ( \stdClass $course)
protected

Returns image URL from course overview files.

Parameters
stdClass$courseCourse object.
Return values
null|stringImage URL or null if it's not exists.

◆ get_instance_for_cache()

static core_course\cache\course_image::get_instance_for_cache ( cache_definition $definition)
static

Returns an instance of the data source class that the cache can use for loading data using the other methods specified by this interface.

Parameters
cache_definition$definition
Return values
core_course\cache\course_image

Implements cache_data_source.

◆ load_for_cache()

core_course\cache\course_image::load_for_cache ( $key)

Loads the data for the key provided ready formatted for caching.

Parameters
string | int$keyThe key to load.
Return values
string|boolReturns course image url as a string or false if the image is not exist

Implements cache_data_source.

◆ load_many_for_cache()

core_course\cache\course_image::load_many_for_cache ( array $keys)

Loads several keys for the cache.

Parameters
array$keysAn array of keys each of which will be string|int.
Return values
arrayAn array of matching data items.

Implements cache_data_source.


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