Javatpoint Logo
Javatpoint Logo

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:

Operation Name Description
Inserting afterCreate It runs after the required operation over the database system only when an inserting operation is being made.
Updating afterUpdate It runs after the required operation over the database system only when an updating operation is being made.
Inserting/Updating afterSave It runs after the required operation over the database system.
Inserting/Updating afterValidation It is executed after the fields are validated for not nulls/empty strings or foreign keys.
Inserting afterValidationOnCreate It is executed after the fields are validated for not nulls/empty strings or foreign keys when an insertion operation is being made.
Updating afterValidationOnUpdate It is executed after the fields are validated for not nulls/empty strings or foreign keys when an updating operation is being made.
Inserting/Updating beforeValidation It is executed before the fields are validated for not nulls/empty strings or foreign keys.
Inserting beforeCreate It runs before the required operation over the database system only when an inserting operation is being made.
Inserting/Updating beforeSave It runs before the required operation over the database system.

Implementation






Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA