Phalcon Model Events

Models allows user to implement events when operation such as insert/update/delete is implemented to define business rules.

The following are the events supported by Phalcon\Mvc\Model:

OperationNameDescription
InsertingafterCreateIt runs after the required operation over the database system only when an inserting operation is being made.
UpdatingafterUpdateIt runs after the required operation over the database system only when an updating operation is being made.
Inserting/UpdatingafterSaveIt runs after the required operation over the database system.
Inserting/UpdatingafterValidationIt is executed after the fields are validated for not nulls/empty strings or foreign keys.
InsertingafterValidationOnCreateIt is executed after the fields are validated for not nulls/empty strings or foreign keys when an insertion operation is being made.
UpdatingafterValidationOnUpdateIt is executed after the fields are validated for not nulls/empty strings or foreign keys when an updating operation is being made.
Inserting/UpdatingbeforeValidationIt is executed before the fields are validated for not nulls/empty strings or foreign keys.
InsertingbeforeCreateIt runs before the required operation over the database system only when an inserting operation is being made.
Inserting/UpdatingbeforeSaveIt runs before the required operation over the database system.

Implementation






Latest Courses