Using CakePHP 1.3, is there is a callback that is fired after a saveAll() on a model, or a way to implement such a behavior?
Maybe afterSave() already does this?
Specifically, I would like to run a couple particular methods, but only after related items have been saved, and only if the parent item is a newly saved instance.
Something like the $created argument, passed to afterSave(), obviously seems perfect, but I’m at least 90% certain that afterSave() is called on a model after the initial save — which I understand has to happen before the related models are saved (so that they have something to put in the FK field).
What do you suggest for obtaining this behavior?
There isn’t a callback for
Model::saveAll()built into CakePHP, but I believe you can override that method on the model to create your own, like so:I am not currently sure about how to produce a
$createdvariable behavior similar to whatModel::afterSave()has, however.