📜  Phalcon模型事件

📅  最后修改于: 2021-01-07 09:30:01             🧑  作者: Mango

Phalcon模型事件

当执行诸如插入/更新/删除之类的操作来定义业务规则时,模型允许用户实施事件。

以下是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.

实作