class event_repository extends abstract_repository implements event_repository_interface

internal  
 

Event repository for audit log persistence.

Handles the main event table and its child tables (diffs and snapshots) to persist audit trails.

Constants

private TABLE

private TABLE_DIFF

private TABLE_SNAPSHOT

Methods

__construct(event_mapper $mapper)

Constructor.

log(event_interface $event)

Persist an event and its associated data (diffs/snapshots).

event_interface|null
find_by_id(int $id)

Find event by ID and hydrate aggregates.

array
find_by_item(int $itemid, int $limit = 20)

Find latest events for an item.

Details

at line 53
__construct(event_mapper $mapper)

Constructor.

Parameters

event_mapper $mapper

at line 66
event_interface log(event_interface $event)

Persist an event and its associated data (diffs/snapshots).

Parameters

event_interface $event

Return Value

event_interface

The persisted event (with ID)

Exceptions

dml_exception

at line 129
event_interface|null find_by_id(int $id)

Find event by ID and hydrate aggregates.

Parameters

int $id

Return Value

event_interface|null

Exceptions

dml_exception

at line 151
array find_by_item(int $itemid, int $limit = 20)

Find latest events for an item.

Parameters

int $itemid
int $limit

Return Value

array

Exceptions

dml_exception