class audit_log extends abstract_entity implements audit_log_interface

Domain Entity: Audit Log.

Represents a persistent audit record in middag_audit_log.

Methods

mixed
__get(string $name)

Magic getter to allow reading protected properties.

bool
__isset(string $name)

Magic isset to allow checking protected properties.

void
__set(string $name, mixed $value)

Magic setter.

array
jsonSerialize()

Serializes the object to a value that can be natively serialized by json_encode().

__construct(int|null $id, string|null $uuid, string $subjecttype, int|null $subjectid, string|null $subjectkey, int|null $courseid, string $extension, string $eventname, int|null $userid, string $origin = 'system', string|null $correlationid = null, string|null $message = null, array|string|null $contextdata = null, int $hasdiff = 0, int $hassnapshot = 0, int $timecreated = 0)

No description

static audit_log
create(string $extension, string $eventname, int|null $subjectid = null, int|null $userid = null, string $subjecttype = 'item', int|null $courseid = null, string|null $subjectkey = null, string|null $correlationid = null, string|null $uuid = null, int|null $timecreated = null)

Factory method for a new audit log entry.

array
get_diffs()

No description

snapshot_data|null
get_snapshot()

Get the full data snapshot if available.

with_diff(revision_diff $diff)

No description

with_snapshot(snapshot_data $snapshot)

No description

with_message(string $message)

No description

int|null
get_id()

Get the entity unique identifier.

string|null
get_uuid()

Stable identifier for the audit record.

string
get_subjecttype()

Audited subject type.

int|null
get_subjectid()

Audited subject identifier.

string|null
get_subjectkey()

Audited subject natural key.

int|null
get_courseid()

Related course identifier.

int|null
get_itemid()

The ID of the item affected by the event.

string
get_extension()

Get the extension slug that emitted the event.

string
get_eventname()

Get the canonical event name identifier.

string
get_eventtype()

Get the event type identifier.

int|null
get_userid()

Get the user ID responsible for the event.

string
get_origin()

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

string|null
get_message()

Get the optional human-readable message.

string|null
get_correlationid()

Trace correlation identifier.

array
get_contextdata()

No description

bool
has_diff()

Does this event contain field differences?

bool
has_snapshot()

Does this event contain a full item snapshot?

int
get_timecreated()

Get the creation timestamp of the event.

array
to_array()

No description

Details

in abstract_entity at line 39
mixed __get(string $name)

Magic getter to allow reading protected properties.

Parameters

string $name

Property name

Return Value

mixed

in abstract_entity at line 55
bool __isset(string $name)

Magic isset to allow checking protected properties.

Parameters

string $name

Property name

Return Value

bool

in abstract_entity at line 66
void __set(string $name, mixed $value)

Magic setter.

Parameters

string $name

Property name

mixed $value Value

Return Value

void

in abstract_entity at line 80
array jsonSerialize()

Serializes the object to a value that can be natively serialized by json_encode().

Return Value

array

at line 58
__construct(int|null $id, string|null $uuid, string $subjecttype, int|null $subjectid, string|null $subjectkey, int|null $courseid, string $extension, string $eventname, int|null $userid, string $origin = 'system', string|null $correlationid = null, string|null $message = null, array|string|null $contextdata = null, int $hasdiff = 0, int $hassnapshot = 0, int $timecreated = 0)

No description

Parameters

int|null $id
string|null $uuid
string $subjecttype
int|null $subjectid
string|null $subjectkey
int|null $courseid
string $extension
string $eventname
int|null $userid
string $origin
string|null $correlationid
string|null $message
array|string|null $contextdata
int $hasdiff
int $hassnapshot
int $timecreated

at line 86
static audit_log create(string $extension, string $eventname, int|null $subjectid = null, int|null $userid = null, string $subjecttype = 'item', int|null $courseid = null, string|null $subjectkey = null, string|null $correlationid = null, string|null $uuid = null, int|null $timecreated = null)

Factory method for a new audit log entry.

Parameters

string $extension
string $eventname
int|null $subjectid
int|null $userid
string $subjecttype
int|null $courseid
string|null $subjectkey
string|null $correlationid
string|null $uuid
int|null $timecreated

Return Value

audit_log

at line 121
array get_diffs()

No description

Return Value

array

at line 126
snapshot_data|null get_snapshot()

Get the full data snapshot if available.

Return Value

snapshot_data|null

at line 131
audit_log with_diff(revision_diff $diff)

No description

Parameters

revision_diff $diff

Return Value

audit_log

at line 144
audit_log with_snapshot(snapshot_data $snapshot)

No description

Parameters

snapshot_data $snapshot

Return Value

audit_log

at line 153
audit_log with_message(string $message)

No description

Parameters

string $message

Return Value

audit_log

at line 161
int|null get_id()

Get the entity unique identifier.

Returns null if the entity has not been persisted yet.

Return Value

int|null

at line 166
string|null get_uuid()

Stable identifier for the audit record.

Return Value

string|null

at line 171
string get_subjecttype()

Audited subject type.

Return Value

string

at line 176
int|null get_subjectid()

Audited subject identifier.

Return Value

int|null

at line 181
string|null get_subjectkey()

Audited subject natural key.

Return Value

string|null

at line 186
int|null get_courseid()

Related course identifier.

Return Value

int|null

at line 191
int|null get_itemid()

The ID of the item affected by the event.

Return Value

int|null

at line 196
string get_extension()

Get the extension slug that emitted the event.

Return Value

string

at line 201
string get_eventname()

Get the canonical event name identifier.

Return Value

string

at line 206
string get_eventtype()

Get the event type identifier.

Return Value

string

at line 211
int|null get_userid()

Get the user ID responsible for the event.

Return Value

int|null

at line 216
string get_origin()

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

Return Value

string

at line 221
string|null get_message()

Get the optional human-readable message.

Return Value

string|null

at line 226
string|null get_correlationid()

Trace correlation identifier.

Return Value

string|null

at line 234
array get_contextdata()

No description

Return Value

array

at line 239
bool has_diff()

Does this event contain field differences?

Return Value

bool

at line 244
bool has_snapshot()

Does this event contain a full item snapshot?

Return Value

bool

at line 249
int get_timecreated()

Get the creation timestamp of the event.

Return Value

int

at line 257
array to_array()

No description

Return Value

array