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-Data-hasOne-hasMany-belongsTo-84
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 <nancy.milli...@gmail.com> 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 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 -~----------~----~----~----~------~----~------~--~---