查詢事件

查詢事件(V5.0.4+)

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

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

查詢事件僅支持find、selectinsert、updatedelete方法。

注冊事件

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

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

文檔
目錄

深色
模式

切換
寬度