item_revision
class item_revision extends abstract_entity implements item_revision_interface
Domain Entity: Revision.
Represents a frozen state of an Item stored in middag_item_revision.
This entity is strictly immutable once created.
Traits
Trait has_status.
Properties
| string | $status | Expected property on the using class. |
from has_status |
Methods
Serializes the object to a value that can be natively serialized by json_encode().
Check if the current status matches a specific value or Enum case.
Create an immutable revision snapshot.
Get the revision database identifier.
Get the original item ID.
Get the sequential revision number.
Get the format identifier (json, structured, etc.).
Get the item type stored in this revision.
Get the context ID snapshot.
Get the course ID snapshot.
Get the owner/author ID snapshot.
Get the parent item snapshot.
Get the full name snapshot.
Get the short name snapshot.
Get the idnumber snapshot.
Get the description snapshot.
Get the description format snapshot.
Get the status recorded in this revision.
Get the raw visibility flag.
Domain visibility check.
Get the sort order snapshot.
Get the version snapshot.
Get the user who last modified the original item.
Get the user who created the revision.
Get the timestamp when the revision was created.
Retrieve a specific metadata value from this revision.
Check if metadata existed in this revision.
No description
Converts the revision back to an array for potential restoration.
Details
in
abstract_entity at line 37
mixed
__get(string $name)
Magic getter to allow reading protected properties.
in
abstract_entity at line 53
bool
__isset(string $name)
Magic isset to allow checking protected properties.
in
abstract_entity at line 64
void
__set(string $name, mixed $value)
Magic setter.
in
abstract_entity at line 78
array
jsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
in
has_status at line 39
bool
is_status(item_status|string $value)
Check if the current status matches a specific value or Enum case.
in
has_status at line 61
bool
is_draft()
Determine if the item is in draft state.
in
has_status at line 69
bool
is_published()
Determine if the item is published.
in
has_status at line 77
bool
is_archived()
Determine if the item is archived.
in
has_status at line 85
bool
is_deleted()
Determine if the item is marked as deleted.
in
has_status at line 97
bool
is_active()
Check if the item is active.
in
has_status at line 105
bool
is_inactive()
Check if the item is inactive.
in
has_status at line 113
bool
is_enabled()
Check if the item is enabled.
in
has_status at line 121
bool
is_disabled()
Check if the item is disabled.
in
has_status at line 133
bool
is_pending()
Check if the item awaits processing.
in
has_status at line 141
bool
is_approved()
Check if the item is approved.
in
has_status at line 149
bool
is_rejected()
Check if the item was rejected.
in
has_status at line 161
bool
is_not_started()
Check if the item has not started.
in
has_status at line 169
bool
is_in_progress()
Check if the item is in progress.
in
has_status at line 177
bool
is_completed()
Check if the item is completed.
in
has_status at line 185
bool
is_failed()
Check if the item has failed.
in
has_status at line 193
bool
is_expired()
Check if the item is expired.
in
has_status at line 201
bool
is_canceled()
Check if the item is canceled.
in
has_status at line 209
bool
is_paused()
Check if the item is paused.
in
has_status at line 221
bool
is_queued()
Check if the item is queued.
in
has_status at line 229
bool
is_running()
Check if the item is running.
in
has_status at line 237
bool
is_syncing()
Check if the item is syncing.
in
has_status at line 245
bool
is_synced()
Check if the item finished syncing.
in
has_status at line 257
bool
is_error()
Check if the item is in an error state.
at line 59
__construct(int|null $id, int $itemid, int $revisionnumber, string $revisionformat, string $type, int|null $contextid, int|null $courseid, int|null $userid, int|null $parent, string|null $fullname, string|null $shortname, string|null $idnumber, string|null $description, int $descriptionformat, string $status, int $visible, int $sortorder, string|null $version, int|null $usermodified, int|null $usercreated, int $timecreated, array $metadata = [])
Create an immutable revision snapshot.
at line 89
int|null
get_id()
Get the revision database identifier.
at line 97
int
get_itemid()
Get the original item ID.
at line 105
int
get_revisionnumber()
Get the sequential revision number.
at line 113
string
get_revisionformat()
Get the format identifier (json, structured, etc.).
at line 121
string
get_type()
Get the item type stored in this revision.
at line 129
int|null
get_contextid()
Get the context ID snapshot.
at line 137
int|null
get_courseid()
Get the course ID snapshot.
at line 145
int|null
get_userid()
Get the owner/author ID snapshot.
at line 153
int|null
get_parent()
Get the parent item snapshot.
at line 161
string|null
get_fullname()
Get the full name snapshot.
at line 169
string|null
get_shortname()
Get the short name snapshot.
at line 177
string|null
get_idnumber()
Get the idnumber snapshot.
at line 185
string|null
get_description()
Get the description snapshot.
at line 193
int
get_descriptionformat()
Get the description format snapshot.
at line 201
string
get_status()
Get the status recorded in this revision.
at line 209
int
get_visible()
Get the raw visibility flag.
at line 217
bool
is_visible()
Domain visibility check.
at line 225
int
get_sortorder()
Get the sort order snapshot.
at line 233
string|null
get_version()
Get the version snapshot.
at line 241
int|null
get_usermodified()
Get the user who last modified the original item.
at line 249
int|null
get_usercreated()
Get the user who created the revision.
at line 257
int
get_timecreated()
Get the timestamp when the revision was created.
at line 262
mixed
get_meta(string $key, mixed $default = null)
Retrieve a specific metadata value from this revision.
at line 267
bool
has_meta(string $key)
Check if metadata existed in this revision.
at line 275
array
get_all_meta()
No description
at line 285
array
to_array()
Converts the revision back to an array for potential restoration.