Events
The Elegant ORM emits events at different intervals whenever something happens, You just have to hook into them.
Triggering model events.
Whenever a model is accessed, whether by querying the database for records or inserting a record or updating a record or even deleting a record, events are triggered, they include:
onCreating
onCreated
onSaving
onSaved
onUpdating
onUpdated
onDeleting
onDeleted
onSelecting
onSelected
Each of the events is a method that you have to implement in your model as follows:
Let's say that you want to return all fullnames in upper case of users that exist in the database after you have selected them, this is how you would do it.
Last updated