Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Versionable cache data source. More...
Public Member Functions | |
load_for_cache ($key) | |
Loads the data for the key provided ready formatted for caching. | |
load_for_cache_versioned ($key, int $requiredversion, &$actualversion) | |
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. | |
Versionable cache data source.
This interface extends the main cache data source interface to add an extra required method if the data source is to be used for a versioned cache.
|
staticinherited |
Returns an instance of the data source class that the cache can use for loading data using the other methods specified by this interface.
cache_definition | $definition |
object |
Implemented in core_course\cache\course_image, mod_assign\cache\overrides, mod_lesson\cache\overrides, mod_quiz\cache\overrides, mod_scorm\cache\elements, and question_finder.
|
inherited |
Loads the data for the key provided ready formatted for caching.
string | int | $key | The key to load. |
mixed | What ever data should be returned, or false if it can't be loaded. |
Implemented in core_course\cache\course_image, core_message\time_last_message_between_users, mod_assign\cache\overrides, mod_lesson\cache\overrides, mod_quiz\cache\overrides, mod_scorm\cache\elements, and question_finder.
cache_data_source_versionable::load_for_cache_versioned | ( | $key, | |
int | $requiredversion, | ||
& | $actualversion ) |
Loads the data for the key provided ready formatted for caching.
If there is no data for that key, or if the data for the required key has an older version than the specified $requiredversion, then this returns null.
If there is data then $actualversion should be set to the actual version number retrieved (may be the same as $requiredversion or newer).
string | int | $key | The key to load. |
int | $requiredversion | Minimum required version |
mixed | $actualversion | Should be set to the actual version number retrieved |
mixed | What ever data should be returned, or false if it can't be loaded. |
|
inherited |
Loads several keys for the cache.
array | $keys | An array of keys each of which will be string|int. |
array | An array of matching data items. |
Implemented in core_course\cache\course_image, core_message\time_last_message_between_users, mod_assign\cache\overrides, mod_lesson\cache\overrides, mod_quiz\cache\overrides, mod_scorm\cache\elements, and question_finder.