查詢事件

查詢事件(V5.0.4+)

5.0.4+版本開始,增加了數(shù)據(jù)庫(kù)的CURD操作事件支持,包括:

事件 描述
before_select select查詢前回調(diào)
before_find find查詢前回調(diào)
after_insert insert操作成功后回調(diào)
after_update update操作成功后回調(diào)
after_delete delete操作成功后回調(diào)

查詢事件僅支持findselect、insert、updatedelete方法。

注冊(cè)事件

使用下面的方法注冊(cè)數(shù)據(jù)庫(kù)查詢事件

Query::event('after_insert','callback');
Query::event('before_select',function($options,$query){
	// 事件處理
    return $result;
});
文檔最后更新時(shí)間:2018-04-26 09:54:27

文檔
目錄

深色
模式

切換
寬度