Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core_cache\cacheable_object_interface Interface Reference
Inheritance diagram for core_cache\cacheable_object_interface:
core_cache\cacheable_object_array

Public Member Functions

 prepare_to_cache ()
 Prepares the object for caching.
 

Static Public Member Functions

static wake_from_cache ($data)
 Takes the data provided by prepare_to_cache and reinitialises an instance of the associated from it.
 

Member Function Documentation

◆ prepare_to_cache()

core_cache\cacheable_object_interface::prepare_to_cache ( )

Prepares the object for caching.

Works like the __sleep method.

Return values
mixedThe data to cache, can be anything except a class that implements the cacheable_object... that would be dumb.

Implemented in core_cache\cacheable_object_array.

◆ wake_from_cache()

static core_cache\cacheable_object_interface::wake_from_cache ( $data)
static

Takes the data provided by prepare_to_cache and reinitialises an instance of the associated from it.

Parameters
mixed$data
Return values
objectThe instance for the given data.

Implemented in core_cache\cacheable_object_array.


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