event_interface extends entity_interface
Interface Event (Audit Log).
Contract for the audit log entity found in middag_event.
Represents an immutable record of something that happened in the system.
Table of Contents
Methods
- get_contextdata() : array<string, mixed>
- Returns the structured context data associated with the event.
- get_diffs() : array<string|int, revision_diff>
- Get the list of changes associated with this event.
- get_eventtype() : string
- Get the event type identifier.
- get_extension() : string
- Get the extension slug that emitted the event.
- get_id() : null|int
- Get the entity unique identifier.
- get_itemid() : null|int
- The ID of the item affected by the event.
- get_message() : string|null
- Get the optional human-readable message.
- get_origin() : string
- Get the origin source (e.g., web, api).
- get_snapshot() : null|snapshot_data
- Get the full data snapshot if available.
- get_timecreated() : int
- Get the creation timestamp of the event.
- get_userid() : int|null
- Get the user ID responsible for the event.
- has_diff() : bool
- Does this event contain field differences?
- has_snapshot() : bool
- Does this event contain a full item snapshot?
- to_array() : array<string, mixed>
- Convert the entity state to a plain associative array.
Methods
get_contextdata()
Returns the structured context data associated with the event.
public
get_contextdata() : array<string, mixed>
Decoded from JSON storage into an array.
Return values
array<string, mixed>get_diffs()
Get the list of changes associated with this event.
public
get_diffs() : array<string|int, revision_diff>
Return values
array<string|int, revision_diff>get_eventtype()
Get the event type identifier.
public
get_eventtype() : string
Return values
stringget_extension()
Get the extension slug that emitted the event.
public
get_extension() : string
Return values
stringget_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_itemid()
The ID of the item affected by the event.
public
get_itemid() : null|int
Return values
null|intget_message()
Get the optional human-readable message.
public
get_message() : string|null
Return values
string|nullget_origin()
Get the origin source (e.g., web, api).
public
get_origin() : string
Return values
stringget_snapshot()
Get the full data snapshot if available.
public
get_snapshot() : null|snapshot_data
Return values
null|snapshot_dataget_timecreated()
Get the creation timestamp of the event.
public
get_timecreated() : int
Return values
intget_userid()
Get the user ID responsible for the event.
public
get_userid() : int|null
Return values
int|nullhas_diff()
Does this event contain field differences?
public
has_diff() : bool
Return values
boolhas_snapshot()
Does this event contain a full item snapshot?
public
has_snapshot() : 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.