Home » Phalcon Model Events

Phalcon Model Events

by Online Tutorials Library

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 PhalconMvcModel:

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

You may also like