revision_service_interface
Contract for the revision service responsible for recording state transitions (create, update, delete) of items.
A revision always represents a transition between two states:
- CREATE: old = null, new = item
- UPDATE: old = item, new = item
- DELETE: old = item, new = null
Implementations of this interface MUST:
- Never modify the item state
- Never block the CRUD operation
- Persist only audit/revision data
- Be deterministic and idempotent when possible
Table of Contents
Methods
- create_revision() : void
- Records a revision according to the previous and new state.
Methods
create_revision()
Records a revision according to the previous and new state.
public
create_revision(null|item_interface $old, null|item_interface $new) : void
Parameters
- $old : null|item_interface
-
Previous entity state (or null during creation)
- $new : null|item_interface
-
New entity state (or null during deletion)