revision_interface extends 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.
Table of Contents
Methods
- get_all_meta() : array<string, mixed>
- Get all metadata stored in this revision.
- get_contextid() : int|null
- Get the context ID associated with the revision.
- get_courseid() : int|null
- Get the course ID associated with the revision.
- get_description() : string|null
- Get the description text captured in the revision.
- get_descriptionformat() : int
- Get the Moodle format constant for the description.
- get_fullname() : string|null
- Get the full name stored in the revision.
- get_guid() : string|null
- Get the GUID reference if present in the revision.
- get_id() : null|int
- Get the entity unique identifier.
- get_idnumber() : string|null
- Get the external idnumber stored in the revision.
- get_itemid() : int
- Get the ID of the original item this revision belongs to.
- get_meta() : mixed
- Retrieve a specific metadata value from this revision.
- get_parent() : int|null
- Get the parent item ID if hierarchical.
- get_revisionformat() : string
- Get the revision format identifier.
- get_revisionnumber() : int
- Get the revision number.
- get_shortname() : string|null
- Get the short name stored in the revision.
- get_sortorder() : int
- Get the sort order value captured in the revision.
- get_status() : string
- Get the status recorded in the revision.
- get_timecreated() : int
- Get the timestamp when the revision was created.
- get_type() : string
- Get the item type identifier stored in the revision.
- get_usercreated() : int|null
- Get the user who created the revision.
- get_userid() : int|null
- Get the user ID linked to the revision.
- get_usermodified() : int|null
- Get the user who last modified the original item.
- get_version() : string|null
- Get the version string stored in the revision.
- get_visible() : int
- Get the raw visibility flag stored in the revision.
- has_meta() : bool
- Check if metadata existed in this revision.
- is_visible() : bool
- Check if the revision marks the item as visible.
- to_array() : array<string, mixed>
- Convert the entity state to a plain associative array.
Methods
get_all_meta()
Get all metadata stored in this revision.
public
get_all_meta() : array<string, mixed>
Return values
array<string, mixed>get_contextid()
Get the context ID associated with the revision.
public
get_contextid() : int|null
Return values
int|nullget_courseid()
Get the course ID associated with the revision.
public
get_courseid() : int|null
Return values
int|nullget_description()
Get the description text captured in the revision.
public
get_description() : string|null
Return values
string|nullget_descriptionformat()
Get the Moodle format constant for the description.
public
get_descriptionformat() : int
Return values
intget_fullname()
Get the full name stored in the revision.
public
get_fullname() : string|null
Return values
string|nullget_guid()
Get the GUID reference if present in the revision.
public
get_guid() : string|null
Return values
string|nullget_id()
Get the entity unique identifier.
public
get_id() : null|int
Returns null if the entity has not been persisted yet.
Return values
null|intget_idnumber()
Get the external idnumber stored in the revision.
public
get_idnumber() : string|null
Return values
string|nullget_itemid()
Get the ID of the original item this revision belongs to.
public
get_itemid() : int
Return values
intget_meta()
Retrieve a specific metadata value from this revision.
public
get_meta(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
get_parent()
Get the parent item ID if hierarchical.
public
get_parent() : int|null
Return values
int|nullget_revisionformat()
Get the revision format identifier.
public
get_revisionformat() : string
Return values
stringget_revisionnumber()
Get the revision number.
public
get_revisionnumber() : int
Return values
intget_shortname()
Get the short name stored in the revision.
public
get_shortname() : string|null
Return values
string|nullget_sortorder()
Get the sort order value captured in the revision.
public
get_sortorder() : int
Return values
intget_status()
Get the status recorded in the revision.
public
get_status() : string
Return values
stringget_timecreated()
Get the timestamp when the revision was created.
public
get_timecreated() : int
Return values
intget_type()
Get the item type identifier stored in the revision.
public
get_type() : string
Return values
stringget_usercreated()
Get the user who created the revision.
public
get_usercreated() : int|null
Return values
int|nullget_userid()
Get the user ID linked to the revision.
public
get_userid() : int|null
Return values
int|nullget_usermodified()
Get the user who last modified the original item.
public
get_usermodified() : int|null
Return values
int|nullget_version()
Get the version string stored in the revision.
public
get_version() : string|null
Return values
string|nullget_visible()
Get the raw visibility flag stored in the revision.
public
get_visible() : int
Return values
inthas_meta()
Check if metadata existed in this revision.
public
has_meta(string $key) : bool
Parameters
- $key : string
Return values
boolis_visible()
Check if the revision marks the item as visible.
public
is_visible() : bool
Return values
boolto_array()
Convert the entity state to a plain associative array.
public
to_array() : array<string, mixed>
Useful for DTO conversion, logging, or debugging.