class event_service implements event_service_interface

internal  
 

Event service (audit & dispatcher).

Responsibilities:

  1. Create persistent Audit Logs (middag_event) with Diffs.
  2. Dispatch Moodle native events for hook compatibility.

Methods

__construct(event_repository_interface $repository, diff_builder_service $diff_builder)

Constructor.

void
item_created(item_interface $item)

Log item creation.

void
item_updated(item_interface $old, item_interface $new)

Log item update with diffs.

void
item_deleted(int $id)

Log item deletion.

Details

at line 45
__construct(event_repository_interface $repository, diff_builder_service $diff_builder)

Constructor.

Parameters

event_repository_interface $repository
diff_builder_service $diff_builder

at line 57
void item_created(item_interface $item)

Log item creation.

Parameters

item_interface $item

the created item with full entity data

Return Value

void

Exceptions

dml_exception

at line 81
void item_updated(item_interface $old, item_interface $new)

Log item update with diffs.

Parameters

item_interface $old

State before update

item_interface $new

State after update

Return Value

void

Exceptions

dml_exception

at line 117
void item_deleted(int $id)

Log item deletion.

Parameters

int $id

the ID of the deleted item

Return Value

void

Exceptions

dml_exception