class audit_log_repository extends abstract_repository implements audit_log_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(audit_log_mapper $mapper)

Constructor.

log(audit_log_interface $event)

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

audit_log_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(audit_log_mapper $mapper)

Constructor.

Parameters

audit_log_mapper $mapper

at line 66
audit_log_interface log(audit_log_interface $event)

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

Parameters

audit_log_interface $event

Return Value

audit_log_interface

The persisted event (with ID)

Exceptions

dml_exception

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

Find event by ID and hydrate aggregates.

Parameters

int $id

Return Value

audit_log_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