@
@
@Insout2017-10-20 16:00:31
PHP
@Insout, 2017-10-20 16:00:31

Yii2: How to make it so that when the model is updated, it gets into afterSave?

Good afternoon.
When updating the model via updateAll, the afterSave method does not work.
How to make it so that after the update it gets into it?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-10-20
@BorisKorobkov

updateAll makes a SQL query to the DB.
For afterSave to work, you must first raise all the necessary models with findAll() and then in the save() loop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question