On Thu, Mar 6, 2008 at 2:23 PM, Juan Luis Baptiste
<[EMAIL PROTECTED]> wrote:
> Hi Casey,
>
>
>  On Thu, Mar 6, 2008 at 11:29 AM, daphonz <[EMAIL PROTECTED]> wrote:
>  >
>  >  Use two save commands:
>  >
>  >  $this->A->save($this->data['A']);
>  >  $this->A->B->save($this->data['B']);
>  >
>  >  I think there's a new(er) function called saveAll(), which should do
>  >  what you want automatically.  I'm not sure about the level of
>  >  implementation for that yet, though, it may only be in the latest beta
>  >  release.
>  >
>
>  That was my last resort, but I wanted to avoid it because there is
>  some logic before the save call in B controller that I was trying to
>  avoid duplicating in A controller. I'll take a look at that saveAll
>  method. It's implemented in the last released beta of 1.2 or is in the
>  repository ?
>

Ok I tried it and works, you just need to be sure to call saveAll on
the model that has de hasMany association. Also there seems to be a
bug in that method, it never returns true as described in this ticket:

https://trac.cakephp.org/ticket/4091

Adding a return true at the end of saveAll fixes the problem.

Thanks.

-- 
Juan Luis Baptiste

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to