List of available events
Introduction
This page present a non-exhaustive list of events thrown by your record and explain when they are thworn and the provided arguments.
Available events called by the class "PorteRecord"
Event "record_get"
Listeners are called if a property is not yet set in the object. Pluggable class like "PorteHierarchy" and "PortePosition" use this event at a global level to respectively register the properties "hierarchy" and "Position".
Event "record_model_before"
Listeners are called before a record is associated with its model. It is used by classes like "PorteHierarchy" and "PortePosition" to register new events to feet their requirements.
Event "record_model_after"
Listeners are called after a record is associated with its model.
Event "record_call_after"
Listeners are called if a method does not exist and none of the current record dynamic methods apply.
Event "record_load_before"
Listeners are called before a record is loaded from the database.
Event "record_load_after"
Listeners are called after a record is loaded from the database.
Event "record_create_before"
Listeners are called before a new object is persisted into the database. The event will be thrown on the "save" method and only if the method "isNew" return true.
If one of the registered event return a non null value, the object will not be created in the database and the "save" method will return the listener returned value.
Event "record_create_after"
Listeners are called after a new object is persisted into the database. The event will be thrown on the "save" method and only if the method "isNew" return true.
A non null value return by a listener will alter the return value of the "save" method.
Event "record_update_before"
Listeners are called before an existing object is persisted into the database. The event will be thrown on the "save" method and only if the method "isNew" return false.
Event "record_update_after"
Listeners are called after an existing object is persisted into the database. The event will be thrown on the "save" method and only if the method "isNew" return false.
Event "record_save_before"
Listeners are called before a new or an existing object is saved into the database. It does not prevent the call on other events registered on creation or on update.
This event will be called after "create_before" or "update_before" events if registered
Event "record_save_after"
Listeners are called after a new or an existing object is saved into the database. It does not prevent the call on other events registered after creation and update.
This event will be called after "create_after" or "update_after" events if registered
Event "record_delete_before"
Listeners are called before an object is removed. It is possible to prevent object removal if any of the registered events return a boolean false.
Event "record_delete_after"
Listeners are called after an object is removed.
Event "record_reset_before"
Listeners are called before an object is reset. It could be used to do some clean up before an object lost its stored information.
Event "record_reset_after"
Listeners are called after an object is reset. It could be used to do some clean up once an object is newly re-setup.
Available events called by the class "PorteModel"
Event "model_fields_before"
Listeners are called before a model enrich fields related information. It is used by classes like "PorteHierarchy" and "PortePosition" to modify the structure of the fields before being enriched in the model.
Event "model_fields_after"
Listeners are called after a model enrich fields related information. It is could be used to alter the resuult of the fields enrichment process.