audit_log extends abstract_entity implements audit_log_interface
Domain Entity: Audit Log.
Represents a persistent audit record in middag_audit_log.
Table of Contents
Interfaces
- audit_log_interface
Properties
- $context_data_array : array<string, mixed>
- $correlationid : string|null
- $courseid : int|null
- $diffs : array<string|int, audit_diff_interface>
- $eventname : string
- $extension : string
- $hasdiff : int
- $hassnapshot : int
- $id : int|null
- $message : string|null
- $origin : string
- $snapshot : audit_snapshot_interface|null
- $subjectid : int|null
- $subjectkey : string|null
- $subjecttype : string
- $timecreated : int
- $userid : int|null
- $uuid : string|null
Methods
- __construct() : mixed
- __get() : mixed
- Magic getter to allow reading protected properties.
- __isset() : bool
- Magic isset to allow checking protected properties.
- __set() : void
- Magic setter.
- create() : self
- Factory method for a new audit log entry.
- get_contextdata() : array<string, mixed>
- get_correlationid() : string|null
- get_courseid() : int|null
- get_diffs() : array<string|int, audit_diff_interface>
- get_eventname() : string
- get_eventtype() : string
- get_extension() : string
- get_id() : int|null
- get_itemid() : int|null
- get_message() : string|null
- get_origin() : string
- get_snapshot() : audit_snapshot_interface|null
- get_subjectid() : int|null
- get_subjectkey() : string|null
- get_subjecttype() : string
- get_timecreated() : int
- get_userid() : int|null
- get_uuid() : string|null
- has_diff() : bool
- has_snapshot() : bool
- jsonSerialize() : array<string, mixed>
- Serializes the object to a value that can be natively serialized by json_encode().
- to_array() : array<string, mixed>
- with_diff() : self
- with_message() : self
- with_snapshot() : self
Properties
$context_data_array
private
array<string, mixed>
$context_data_array
= []
$correlationid
private
string|null
$correlationid
= null
$courseid
private
int|null
$courseid
$diffs
private
array<string|int, audit_diff_interface>
$diffs
= []
$eventname
private
string
$eventname
$extension
private
string
$extension
$hasdiff
private
int
$hasdiff
= 0
$hassnapshot
private
int
$hassnapshot
= 0
$id
private
int|null
$id
$message
private
string|null
$message
= null
$origin
private
string
$origin
= 'system'
$snapshot
private
audit_snapshot_interface|null
$snapshot
= null
$subjectid
private
int|null
$subjectid
$subjectkey
private
string|null
$subjectkey
$subjecttype
private
string
$subjecttype
$timecreated
private
int
$timecreated
= 0
$userid
private
int|null
$userid
$uuid
private
string|null
$uuid
Methods
__construct()
public
__construct(null|int $id, null|string $uuid, string $subjecttype, null|int $subjectid, null|string $subjectkey, null|int $courseid, string $extension, string $eventname, null|int $userid[, string $origin = 'system' ][, null|string $correlationid = null ][, null|string $message = null ][, null|array<string, mixed>|string $contextdata = null ][, int $hasdiff = 0 ][, int $hassnapshot = 0 ][, int $timecreated = 0 ]) : mixed
Parameters
- $id : null|int
- $uuid : null|string
- $subjecttype : string
- $subjectid : null|int
- $subjectkey : null|string
- $courseid : null|int
- $extension : string
- $eventname : string
- $userid : null|int
- $origin : string = 'system'
- $correlationid : null|string = null
- $message : null|string = null
- $contextdata : null|array<string, mixed>|string = null
- $hasdiff : int = 0
- $hassnapshot : int = 0
- $timecreated : int = 0
__get()
Magic getter to allow reading protected properties.
public
__get(string $name) : mixed
Parameters
- $name : string
-
Property name
__isset()
Magic isset to allow checking protected properties.
public
__isset(string $name) : bool
Parameters
- $name : string
-
Property name
Return values
bool__set()
Magic setter.
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
-
Property name
- $value : mixed
-
Value
create()
Factory method for a new audit log entry.
public
static 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 ]) : self
Parameters
- $extension : string
- $eventname : string
- $subjectid : int|null = null
- $userid : int|null = null
- $subjecttype : string = 'item'
- $courseid : int|null = null
- $subjectkey : string|null = null
- $correlationid : string|null = null
- $uuid : string|null = null
- $timecreated : int|null = null
Return values
selfget_contextdata()
public
get_contextdata() : array<string, mixed>
Return values
array<string, mixed>get_correlationid()
public
get_correlationid() : string|null
Return values
string|nullget_courseid()
public
get_courseid() : int|null
Return values
int|nullget_diffs()
public
get_diffs() : array<string|int, audit_diff_interface>
Return values
array<string|int, audit_diff_interface>get_eventname()
public
get_eventname() : string
Return values
stringget_eventtype()
public
get_eventtype() : string
Return values
stringget_extension()
public
get_extension() : string
Return values
stringget_id()
public
get_id() : int|null
Return values
int|nullget_itemid()
public
get_itemid() : int|null
Return values
int|nullget_message()
public
get_message() : string|null
Return values
string|nullget_origin()
public
get_origin() : string
Return values
stringget_snapshot()
public
get_snapshot() : audit_snapshot_interface|null
Return values
audit_snapshot_interface|nullget_subjectid()
public
get_subjectid() : int|null
Return values
int|nullget_subjectkey()
public
get_subjectkey() : string|null
Return values
string|nullget_subjecttype()
public
get_subjecttype() : string
Return values
stringget_timecreated()
public
get_timecreated() : int
Return values
intget_userid()
public
get_userid() : int|null
Return values
int|nullget_uuid()
public
get_uuid() : string|null
Return values
string|nullhas_diff()
public
has_diff() : bool
Return values
boolhas_snapshot()
public
has_snapshot() : bool
Return values
booljsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
public
jsonSerialize() : array<string, mixed>
Tags
Return values
array<string, mixed>to_array()
public
to_array() : array<string, mixed>
Return values
array<string, mixed>with_diff()
public
with_diff(audit_diff_interface $diff) : self
Parameters
- $diff : audit_diff_interface
Return values
selfwith_message()
public
with_message(string $message) : self
Parameters
- $message : string
Return values
selfwith_snapshot()
public
with_snapshot(audit_snapshot_interface $snapshot) : self
Parameters
- $snapshot : audit_snapshot_interface