Re: Persisting complex model data at once

2010-07-12 Thread Soniya Ahuja
@Jeremy Burns: thanks for the reply. Actually, the fact that saveAll
saves only n+1 data is mentioned in the cook book, but I had somehow
missed it(though it was put up in a notice... lousy me). So I had to
loop through the data and wrapped this in a transaction. As saveAll
doesn't revert transaction is rolled back, I had to use save instead
and rollback the transaction if anything went wrong.

Thanks

On Jun 18, 7:44 pm, Jeremy Burns | Class Outfit
 wrote:
> I *think* that saveAll only goes to the level n+1, not level n+2. You might 
> have to loop through the data array call saveAll repetitively. PITA, I know.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 17 Jun 2010, at 22:10,SoniyaAhuja wrote:
>
> > Hi,
>
> > I have a Model structure such that Model1 hasMany Model2 and Model2
> > hasMany Model3. Now, I have designed a form for Model1 and it contains
> > fields for Model2 and Model3 as well.
>
> > I see that calling a saveAll on Model1 validates and persists the data
> > for Model2 but it does not validate or persist the data for Model3.
>
> > Could anyone tell me how to get this particular piece working?
>
> > Sorry if this is a repetition of some question asked earlier, I didn't
> > find anything similar with the keywords that I used to search the
> > group discussions.
>
> > Thanks.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Persisting complex model data at once

2010-06-18 Thread Jeremy Burns | Class Outfit
I *think* that saveAll only goes to the level n+1, not level n+2. You might 
have to loop through the data array call saveAll repetitively. PITA, I know.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Jun 2010, at 22:10, Soniya Ahuja wrote:

> Hi,
> 
> I have a Model structure such that Model1 hasMany Model2 and Model2
> hasMany Model3. Now, I have designed a form for Model1 and it contains
> fields for Model2 and Model3 as well.
> 
> I see that calling a saveAll on Model1 validates and persists the data
> for Model2 but it does not validate or persist the data for Model3.
> 
> Could anyone tell me how to get this particular piece working?
> 
> Sorry if this is a repetition of some question asked earlier, I didn't
> find anything similar with the keywords that I used to search the
> group discussions.
> 
> Thanks.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Persisting complex model data at once

2010-06-18 Thread Soniya Ahuja
Hi,

I have a Model structure such that Model1 hasMany Model2 and Model2
hasMany Model3. Now, I have designed a form for Model1 and it contains
fields for Model2 and Model3 as well.

I see that calling a saveAll on Model1 validates and persists the data
for Model2 but it does not validate or persist the data for Model3.

Could anyone tell me how to get this particular piece working?

Sorry if this is a repetition of some question asked earlier, I didn't
find anything similar with the keywords that I used to search the
group discussions.

Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en