Server - Events
SapphireDb has different event hooks for models that can used to manipulate the behavior of the model when created, updated or removed
Available event attributes:
- before: The method will get executed before the model get's manipulated by SapphireDb
- beforeSave: The method will get executed before the model get's stored in database
- after: The method will get executed after the model was stored in database
HttpInformation-object with information about the request and the instances found in the
This example demonstrates the use of event attributes.
The example has 5 event-methods.
Two of the methods update the date fields when the model is created or updated.
The other methods create entries in the collection logs for each action.