我有一個行爲,更新的紀錄,而不是從beforeDelete
回調刪除。停止回調傳播
public function beforeDelete(Model $model, $cascade = true) {
[...]
return true;
}
當我回到true
,刪除proccess繼續而不是停止。我不想停止傳播下一個事件delete
。
我已閱讀關於stopPropagation()
函數CakeEvent
但不知道該怎麼做,以及如何正確使用行爲。你可以幫我嗎?
行爲延伸'ModelBehavior',其中有隻有兩個參數定義的回調。我會嘗試'$ model-> getEventManager()'..謝謝! –