afterSave()
is thought for a single record. updateAll()
handles many records in a completly different way. So you cannot use afterSave()
this way. Imagine: when you update thousands of records this way, the afterSave()
methods would need to be executed for each record - you would probably need something like afterSaveAll()
that gets called once and that does only a single (or some few) further update, right?
Yii2 使用updateAll批量修改不觸發 afterSave()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.