I have 2 similar pairs of tables (Table1 and Table2, TableA and TableB).
Table1 has many Table2. Table2 belongs to Table1. In other words, there is a one-to-many relationship between Table1 and Table2. TableA and TableB has the same one-to-many relationship as Table1 and Table2.
I would like to move a row in Table1 plus all the associated rows in Table2 to the matching table pair TableA and TableB.
What is the best way to transfer the table row and the associated rows? Do I save each row to the new table one by one using save() or is there a way to save all the rows at one go using saveall()?
Is it a problem to use saveall() to do the data transfer if the table fields are similar but not exactly the same. Between the table pair, some rows are the same and some rows are different.
I am using Cakephp 2.4.5. Thank you for your help.