I was reading through http://book.cakephp.org/3.0/en/orm/query-builder.html
when I found myself wondering if the usual callbacks like Model
.afterSave
will still triggered if I write a query like this:
$query = $articles->query();
$query->update()
->set(['published' => true])
->where(['id' => $id])
->execute();
What should I do if it does not and I still want to trigger the callbacks while using the query builder to run update operations?
The reason is because I want to update another model called Authors
after this query is updated.