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()
最新推荐文章于 2022-02-21 11:48:09 发布