event_service_interface
Contract for the event service responsible for emitting item lifecycle events.
Implementations of this interface MUST:
- Never throw exceptions that could interrupt CRUD operations
- Execute in a fire-and-forget or best-effort manner
- Contain no business logic; only event dispatching or logging
Table of Contents
Methods
- item_created() : void
- Fired after an item is successfully created.
- item_deleted() : void
- Fired after an item is successfully deleted.
- item_updated() : void
- Fired after an item is successfully updated.
Methods
item_created()
Fired after an item is successfully created.
public
item_created(item_interface $item) : void
Parameters
- $item : item_interface
-
the created item with full entity data
item_deleted()
Fired after an item is successfully deleted.
public
item_deleted(int $id) : void
Parameters
- $id : int
-
the ID of the deleted item
item_updated()
Fired after an item is successfully updated.
public
item_updated(item_interface $old, item_interface $new) : void
Requires both OLD and NEW states to calculate differences (Diffs).
Parameters
- $old : item_interface
-
State before update
- $new : item_interface
-
State after update