event
class event extends event
Public SDK Event Entity.
Represents domain events emitted by the framework; use it for typing or to extend with data specific to your extension.
Methods
Serializes the object to a value that can be natively serialized by json_encode().
Instantiate an Event aggregate.
Factory method to start a new event recording.
Details
in
abstract_entity at line 39
mixed
__get(string $name)
Magic getter to allow reading protected properties.
in
abstract_entity at line 55
bool
__isset(string $name)
Magic isset to allow checking protected properties.
in
abstract_entity at line 66
void
__set(string $name, mixed $value)
Magic setter.
in
abstract_entity at line 80
array
jsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
in
event at line 56
__construct(int|null $id, int|null $itemid, string $extension, string $eventtype, int|null $userid, string $origin = 'system', string|null $message = null, array|string|null $contextdata = null, int $hasdiff = 0, int $hassnapshot = 0, int $timecreated = 0)
Instantiate an Event aggregate.
in
event at line 88
static event
create(string $extension, string $eventtype, int|null $itemid = null, int|null $userid = null, int|null $timecreated = null)
Factory method to start a new event recording.
in
event at line 119
event
with_diff(revision_diff $diff)
Returns a new Event instance with the added Diff.
in
event at line 139
event
with_snapshot(snapshot_data $snapshot)
Returns a new Event instance with the snapshot set.
in
event at line 153
array
get_diffs()
Get the list of field changes attached to this event.
in
event at line 161
snapshot_data|null
get_snapshot()
Get the full snapshot if it was recorded.
in
event at line 171
int|null
get_id()
Get the event database identifier.
in
event at line 179
int|null
get_itemid()
Get the related item identifier.
in
event at line 187
string
get_extension()
Get the emitting extension slug.
in
event at line 195
string
get_eventtype()
Get the event type identifier.
in
event at line 203
int|null
get_userid()
Get the user ID responsible for the action.
in
event at line 211
string
get_origin()
Get the origin source (web, api, cli, system).
in
event at line 219
string|null
get_message()
Get the human-readable message if any.
in
event at line 253
array
get_contextdata()
Get decoded context payload.
in
event at line 261
bool
has_diff()
Check whether diffs were recorded.
in
event at line 269
bool
has_snapshot()
Check whether a snapshot was recorded.
in
event at line 277
int
get_timecreated()
Get creation timestamp.
in
event at line 287
array
to_array()
Export the event as an associative array for serialization.