MIDDAG for Moodle

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_eventtype()

Get the event type identifier.

public get_eventtype() : string
Return values
string

get_extension()

Get the extension slug that emitted the event.

public get_extension() : string
Return values
string

get_id()

Get the entity unique identifier.

public get_id() : null|int

Returns null if the entity has not been persisted yet.

Return values
null|int

get_itemid()

The ID of the item affected by the event.

public get_itemid() : null|int
Return values
null|int

get_message()

Get the optional human-readable message.

public get_message() : string|null
Return values
string|null

get_origin()

Get the origin source (e.g., web, api).

public get_origin() : string
Return values
string

get_timecreated()

Get the creation timestamp of the event.

public get_timecreated() : int
Return values
int

get_userid()

Get the user ID responsible for the event.

public get_userid() : int|null
Return values
int|null

has_diff()

Does this event contain field differences?

public has_diff() : bool
Return values
bool

has_snapshot()

Does this event contain a full item snapshot?

public has_snapshot() : bool
Return values
bool

to_array()

Convert the entity state to a plain associative array.

public to_array() : array<string, mixed>

Useful for DTO conversion, logging, or debugging.

Return values
array<string, mixed>

        
On this page

Search results