I have used saveAll but it doesn't seem to really handle very deep
associations well.  I'm afraid it might not work for this because
we're talking about 40+ tables all linked!

On Sep 18, 11:07 pm, Bert Van den Brande <[email protected]> wrote:
> I haven't done this before, but I think this can be accomplished by using
> the saveAll() function :http://book.cakephp.org/view/75/Saving-Your-Data.
> Have a look at the saveAll() documentation, and also at this section 
> :http://book.cakephp.org/view/75/Saving-Your-Data#Saving-Related-Model...
>
> My approach would be to
> * load the Recipe with it's Ingredients and Tags from database
> * manipulate the data by removing the 'id' information from the models
> * pass the manipulated data to the saveAll() method
>
> Friendly greetings,
> Bert
>
> On Fri, Sep 18, 2009 at 9:16 PM, Nancy <[email protected]> wrote:
>
> > Maybe this is more of a database question than a Cakephp question
> > but...
>
> > I have a database with about 40 tables all related and I'm going to
> > need to make copies of a whole deeply nested database structure, just
> > changing id's be coming the interconnections.  Does anyone know of a
> > reasonable way to do this?
>
> > I'm using MySQL.
>
> > Many thanks!
>
> > Nancy
>
> > Simple Example:
>
> > Recipe -> Ingredients
> >           -> Tags
>
> > Lets say I want to copy the Apple Pie recipe and all it's related
> > records to a new structure but none of the data are shared between the
> > two copies.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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