事件与事件管理器(Events and Events Manager)

Models allow you to implement events that will be thrown when performing an insert/update/delete. They help define business rules for a certain model. The following are the events supported by Phalcon\Mvc\Model and their order of execution:

Operation Name Can stop operation? Explanation
Inserting/Updating beforeValidation YES Is executed before the fields are validated for not nulls/empty strings or foreign keys
Inserting beforeValidationOnCreate YES Is executed before the fields are validated for not nulls/empty strings or foreign keys when an insertion operation is being made
Updating beforeValidationOnUpdate YES Is executed before the fields are validated for not nulls/empty strings or foreign keys when an updating operation is being made
Inserting/Updating onValidationFails YES (already stopped) Is executed after an integrity validator fails
Inserting afterValidationOnCreate YES Is executed after the fields are validated for not nulls/empty strings or foreign keys when an insertion operation is being made
Updating afterValidationOnUpdate YES Is executed after the fields are validated for not nulls/empty strings or foreign keys when an updating operation is being made
Inserting/Updating afterValidation YES Is executed after the fields are validated for not nulls/empty strings or foreign keys
Inserting/Updating beforeSave YES Runs before the required operation over the database system
Updating beforeUpdate YES Runs before the required operation over the database system only when an updating operation is being made
Inserting beforeCreate YES Runs before the required operation over the database system only when an inserting operation is being made
Updating afterUpdate NO Runs after the required operation over the database system only when an updating operation is being made
Inserting afterCreate NO Runs after the required operation over the database system only when an inserting operation is being made
Inserting/Updating afterSave NO Runs after the required operation over the database system

phalcon:model 事件与事件管理器的更多相关文章

  1. cocos2d JS touch(触摸监听)-快速添加事件监听器到管理器

    cc.eventManager.addListener({ event: cc.EventListener.TOUCH_ALL_AT_ONCE, onTouchesMoved: function (t ...

  2. Django 源码小剖: Django ORM 查询管理器

    ORM 查询管理器 对于 ORM 定义: 对象关系映射, Object Relational Mapping, ORM, 是一种程序设计技术,用于实现面向对象编程语言里不同类型系统的数据之间的转换.从 ...

  3. Django ORM 查询管理器

    Django ORM 查询管理器 ORM 查询管理器 对于 ORM 定义: 对象关系映射, Object Relational Mapping, ORM, 是一种程序设计技术,用于实现面向对象编程语言 ...

  4. Container容器控件的使用、Hbox与Vbox布局管理器的使用、以及AjaxAction前后台事件响应

    1.由于有前后台交互功能,需要在Spring上下文中注册一个用于提供服务的bean,对于这个bean使用Spring提供的@Component标注,如果需要使用@Component注解,需要在项目中W ...

  5. [cocos2dx笔记010]用于UI的事件管理器

    cocos2dx有一个编辑器:cocostudio.眼下来说,已经是比較好用了.仅仅要载入导出的资源.就能够用上了.省去手动搭建面的麻烦. 可是.非常多须要事件的地方,操作比較麻烦,所以这里提供一个事 ...

  6. storm事件管理器EventManager源码分析-event.clj

    storm事件管理器定义在event.clj中,主要功能就是通过独立线程执行"事件处理函数".我们可以将"事件处理函数"添加到EventManager的阻塞队列 ...

  7. cocos2d-js v3事件管理器

    总概: 1.时间监听器(cc.EventListener)封装用户的事件处理逻辑. 2.事件管理器(cc.eventManager)管理用户注册的事件监听器. 3.事件对象(cc.Event)包含事件 ...

  8. google跟踪代码管理器gtm无法给相同class元素绑定click事件埋点解决

    Google 跟踪代码管理器是一个跟踪代码管理系统 (TMS),可以帮助您快速轻松地更新网站或移动应用上的跟踪代码及相关代码段(统称为“代码”).将一小段跟踪代码管理器代码添加到项目后,您可以通过网页 ...

  9. EBS并发管理器请求汇总(按照并发消耗时间,等待时间,平均等待事件等汇总)

    此数据集用于确定正在使用中并发管理器,并可与实际的在启动时分配的并发管理器.而且考虑完成状态为 正常/警告 的请求. select q.concurrent_queue_name, count(*) ...

随机推荐

  1. C#中进行单元测试

    首先创建一个项目,写一段待测的程序: namespace ForTest { public class Program { static void Main(string[] args) { } pu ...

  2. 如何让其他计算机访问我的计算机上数据库mysql

    第一种:能ping通,说明你们在同一个网络中,可以直接访问.你只要在你的登录用户中的帐号加上可外部访问就可以了...也就是授权.比如你的帐号是root   你可以进入mysql后, 你可以看到,每个帐 ...

  3. 如何实现百度外卖APP个人中心头像"浪"起来的动画效果

    作为一个中午下班不肯离开工作岗位且勤奋工作的骚年来说,叫外卖就成了不可或缺的习惯.某日瞬间发现百度外卖的APP波浪效果很是吸引人.相比较其他的外卖APP,颜值略高些.(淘宝也有波浪的效果),遂就思考如 ...

  4. P2680 运输计划

    http://www.luogu.org/problem/show?pid=2680#sub 题目背景 公元 2044 年,人类进入了宇宙纪元. 题目描述 L 国有 n 个星球,还有 n-1 条双向航 ...

  5. mvcAPI (入门 1)

    步骤: 1)建立order 类 2)建立OrderEntity类 3)创建控制器API 这时候能看到Json 格式的数据啦 5)想在网页或客户端显示 添加一个网页 如下: <!DOCTYPE h ...

  6. Eclipse常用快捷键windows

    Ctrl+1:快速修正Ctrl+W: 关闭当前文件ctrl+O:打开outlineCtrl+D: 删除当前行 Ctrl+L: 定位在某行Ctrl+Q:转到上次修改位置Ctrl+/:注释代码Ctrl+H ...

  7. Wpf再次学习,分享给入门的朋友

    一.WPF介绍 先说下WPF,她的简称是Windows Presentation Foundation,注意到Presentation这个单词了吧,展现的意思,后面那个是基础,展现基础,WPF是一种展 ...

  8. Visual Studio安装项目中将用户选择的安装路径写入注册表的方法[转]

    在你的工程名上右击 -> View ->Registry(视图 -> 注册表) 在你需要写注册表的主键下,例如我注册firefox插件的例子是: (1)右击HKEY_CURRENT_ ...

  9. Writing Text File From A Tabular Block In Oracle Forms

    The example given below for writing text file or CSV using Text_IO package from a tabular block in O ...

  10. How To Tune or Test PLSQL Code Performance in Oracle D2k Forms

    You can test or tune your program unit performance in Oracle forms with Ora_Prof package.Suppose you ...