I have 2 sets of tables in the same database - A live set and a test set. Each set has two tables in it - table A and table B - with a one-to-many relationship between them.
What I need to do is to select certain records from table A in the test set and copy the records in their entirety, along with their relations in table B, into the live table set. The structure of the sets is identical.
is it possible to do this without having to break the records up manually?
I'm using the doctrine ORM (1.2 I think) in the context of the symfony 1.4 PHP framework.
So far I've been trying something like this:
$record = Doctrine_Core::getTable('testSetTableA')->find(1);
$liveSetTableArecord = new LiveSetTableArecord();
$liveSetTableArecord = $record->copy();
$liveSetTableArecord->save();
But I get the feeling that I'm missing something fundamental. As far as I can tell, there is no method for setting a record in it's entirety from a query object?