Yes, a save() will always trigger behavior's afterSave().
One thing you can do is SVN up and then from your behavior do:
$settings = $this->settings[$Model->alias];
$Model->detach('MyBehavior');
$Model->save( ... );
$Model->attach('MyBehavior', $settings);
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
blog: http://www.MarianoIglesias.com.ar
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: MiƩrcoles, 13 de Febrero de 2008 09:05 p.m.
Para: Cake PHP
Asunto: Never-ending loop in behaviors afterSave?
If in the afterSave function of a behavior i make other saves in the
save model, does the afterSave function gets called again for each
save, and then again and again?
If yes, is there a way to perform the save from the inside the
afterSave function so that this will ignore the behavior (itself)?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---