How do I insert multiple rows into table calling save()
method once in Doctrine?
Add each record to a Doctrine_Collection
the call save()
on the collection object.
$collection = new Doctrine_Collection('tablename'); $collection->add($record1); $collection->add($record2); $collection->add($record3); $collection->add($record4); $collection->save();
This only works if all the records are for the same table. Otherwise you're out of luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With