phalcon:model 事件与事件管理器
事件与事件管理器(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 事件与事件管理器的更多相关文章
- cocos2d JS touch(触摸监听)-快速添加事件监听器到管理器
cc.eventManager.addListener({ event: cc.EventListener.TOUCH_ALL_AT_ONCE, onTouchesMoved: function (t ...
- Django 源码小剖: Django ORM 查询管理器
ORM 查询管理器 对于 ORM 定义: 对象关系映射, Object Relational Mapping, ORM, 是一种程序设计技术,用于实现面向对象编程语言里不同类型系统的数据之间的转换.从 ...
- Django ORM 查询管理器
Django ORM 查询管理器 ORM 查询管理器 对于 ORM 定义: 对象关系映射, Object Relational Mapping, ORM, 是一种程序设计技术,用于实现面向对象编程语言 ...
- Container容器控件的使用、Hbox与Vbox布局管理器的使用、以及AjaxAction前后台事件响应
1.由于有前后台交互功能,需要在Spring上下文中注册一个用于提供服务的bean,对于这个bean使用Spring提供的@Component标注,如果需要使用@Component注解,需要在项目中W ...
- [cocos2dx笔记010]用于UI的事件管理器
cocos2dx有一个编辑器:cocostudio.眼下来说,已经是比較好用了.仅仅要载入导出的资源.就能够用上了.省去手动搭建面的麻烦. 可是.非常多须要事件的地方,操作比較麻烦,所以这里提供一个事 ...
- storm事件管理器EventManager源码分析-event.clj
storm事件管理器定义在event.clj中,主要功能就是通过独立线程执行"事件处理函数".我们可以将"事件处理函数"添加到EventManager的阻塞队列 ...
- cocos2d-js v3事件管理器
总概: 1.时间监听器(cc.EventListener)封装用户的事件处理逻辑. 2.事件管理器(cc.eventManager)管理用户注册的事件监听器. 3.事件对象(cc.Event)包含事件 ...
- google跟踪代码管理器gtm无法给相同class元素绑定click事件埋点解决
Google 跟踪代码管理器是一个跟踪代码管理系统 (TMS),可以帮助您快速轻松地更新网站或移动应用上的跟踪代码及相关代码段(统称为“代码”).将一小段跟踪代码管理器代码添加到项目后,您可以通过网页 ...
- EBS并发管理器请求汇总(按照并发消耗时间,等待时间,平均等待事件等汇总)
此数据集用于确定正在使用中并发管理器,并可与实际的在启动时分配的并发管理器.而且考虑完成状态为 正常/警告 的请求. select q.concurrent_queue_name, count(*) ...
随机推荐
- Solr开发文档
转载:http://www.cnblogs.com/hoojo/archive/2011/10/21/2220431.html Solr 是一种可供企业使用的.基于 Lucene 的搜索服务器,它支持 ...
- Prompt isNaN 数组 function DOM window.open/close/location/history
1.prompt的利用 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Defa ...
- flume ng系列之——flume安装
flume版本:1.5.0 1.下载安装包: http://www.apache.org/dyn/closer.cgi/flume/1.5.0/apache-flume-1.5.0-bin.tar.g ...
- ubuntu APT-GET工作原理
转 http://kurenai.elastos.org/2013/05/02/ubuntu-apt-get%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86/ 先介绍几个和 ...
- Linux网络统计工具/命令
我在Linux(基于CentOS 或者 Debian 的发行版)中该如何查看当前网络端口吞吐量的统计信息?在Linux操作系统中如何查看当前内核snmp计数器以及网络端口的统计信息? 你可以使用以下任 ...
- js模拟表单提交
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- HTML-3月20日课堂总结
1.图片热点 2.表单制作 3.课后作业 1.图片热点 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&qu ...
- block 实现原理(内存管理详解)(二)
在以前,MRC环境下,使用block很可能会出现内存泄漏问题,并且在以往的面试中,一些接触比较久的程序员都会喜欢问到这个问题,block内存泄漏的问题! 下面,我来介绍一下,MRC下Block内存泄漏 ...
- MySQL占用内存过大的问题解决
MySQL竟然变化这么大了,记忆里还是40MB左右的软件. 想找回记忆里大小的软件(老版本的软件),可以去这个地址看看:http://mirrors.soho.com 现在去官网下载都300多MB了… ...
- L0/L1/L2范数的联系与区别
L0/L1/L2范数的联系与区别 标签(空格分隔): 机器学习 最近快被各大公司的笔试题淹没了,其中有一道题是从贝叶斯先验,优化等各个方面比较L0.L1.L2范数的联系与区别. L0范数 L0范数表示 ...