interface revision_interface implements entity_interface

Interface Revision.

Contract for a historical revision of an item. Represents the state of an item at a specific point in time. All revisions are strictly immutable.

Methods

int|null
get_id()

Get the entity unique identifier.

array
to_array()

Convert the entity state to a plain associative array.

int
get_itemid()

Get the ID of the original item this revision belongs to.

int
get_revisionnumber()

Get the revision number.

string
get_revisionformat()

Get the revision format identifier.

string
get_type()

Get the item type identifier stored in the revision.

int|null
get_contextid()

Get the context ID associated with the revision.

int|null
get_courseid()

Get the course ID associated with the revision.

int|null
get_userid()

Get the user ID linked to the revision.

int|null
get_parent()

Get the parent item ID if hierarchical.

string|null
get_fullname()

Get the full name stored in the revision.

string|null
get_shortname()

Get the short name stored in the revision.

string|null
get_idnumber()

Get the external idnumber stored in the revision.

string|null
get_description()

Get the description text captured in the revision.

int
get_descriptionformat()

Get the Moodle format constant for the description.

string
get_status()

Get the status recorded in the revision.

int
get_visible()

Get the raw visibility flag stored in the revision.

bool
is_visible()

Check if the revision marks the item as visible.

string|null
get_guid()

Get the GUID reference if present in the revision.

int
get_sortorder()

Get the sort order value captured in the revision.

string|null
get_version()

Get the version string stored in the revision.

int|null
get_usermodified()

Get the user who last modified the original item.

int|null
get_usercreated()

Get the user who created the revision.

int
get_timecreated()

Get the timestamp when the revision was created.

mixed
get_meta(string $key, mixed $default = null)

Retrieve a specific metadata value from this revision.

bool
has_meta(string $key)

Check if metadata existed in this revision.

array
get_all_meta()

Get all metadata stored in this revision.

Details

in entity_interface at line 36
int|null get_id()

Get the entity unique identifier.

Returns null if the entity has not been persisted yet.

Return Value

int|null

in entity_interface at line 44
array to_array()

Convert the entity state to a plain associative array.

Useful for DTO conversion, logging, or debugging.

Return Value

array

at line 32
int get_itemid()

Get the ID of the original item this revision belongs to.

Return Value

int

at line 37
int get_revisionnumber()

Get the revision number.

Return Value

int

at line 42
string get_revisionformat()

Get the revision format identifier.

Return Value

string

at line 47
string get_type()

Get the item type identifier stored in the revision.

Return Value

string

at line 52
int|null get_contextid()

Get the context ID associated with the revision.

Return Value

int|null

at line 57
int|null get_courseid()

Get the course ID associated with the revision.

Return Value

int|null

at line 62
int|null get_userid()

Get the user ID linked to the revision.

Return Value

int|null

at line 67
int|null get_parent()

Get the parent item ID if hierarchical.

Return Value

int|null

at line 72
string|null get_fullname()

Get the full name stored in the revision.

Return Value

string|null

at line 77
string|null get_shortname()

Get the short name stored in the revision.

Return Value

string|null

at line 82
string|null get_idnumber()

Get the external idnumber stored in the revision.

Return Value

string|null

at line 87
string|null get_description()

Get the description text captured in the revision.

Return Value

string|null

at line 92
int get_descriptionformat()

Get the Moodle format constant for the description.

Return Value

int

at line 97
string get_status()

Get the status recorded in the revision.

Return Value

string

at line 102
int get_visible()

Get the raw visibility flag stored in the revision.

Return Value

int

at line 107
bool is_visible()

Check if the revision marks the item as visible.

Return Value

bool

at line 112
string|null get_guid()

Get the GUID reference if present in the revision.

Return Value

string|null

at line 117
int get_sortorder()

Get the sort order value captured in the revision.

Return Value

int

at line 122
string|null get_version()

Get the version string stored in the revision.

Return Value

string|null

at line 127
int|null get_usermodified()

Get the user who last modified the original item.

Return Value

int|null

at line 132
int|null get_usercreated()

Get the user who created the revision.

Return Value

int|null

at line 137
int get_timecreated()

Get the timestamp when the revision was created.

Return Value

int

at line 149
mixed get_meta(string $key, mixed $default = null)

Retrieve a specific metadata value from this revision.

Parameters

string $key
mixed $default

Return Value

mixed

at line 158
bool has_meta(string $key)

Check if metadata existed in this revision.

Parameters

string $key

Return Value

bool

at line 165
array get_all_meta()

Get all metadata stored in this revision.

Return Value

array