3461 Posts in 1065 Topics by 740 members
|Go to End|
11 December 2011 at 4:20am Last edited: 11 December 2011 4:27am
I'm trying to figure out the most efficient way of adding multiple dataobjects to a componentset - addMany() would work perfectly except there doesn't seem to be the option of including many_many_extraFields data along with the ID array.
Does anyone know of any way this can be done without having to loop through each dataobject and use add()? I'm looking to loop across thousands of records at a time, so efficiency is the most important factor here.
I suppose a batch insert with addMany() could be followed by some sort of batch update, if such a thing exists?
11 December 2011 at 6:44am
So it seems after a bit of digging through Sapphire's core, addMany() is simply a shorthand foreach add() loop, so probably won't help efficiency much.
Perhaps looping through each dataobject and building a manual SQL command to execute at the end of the loop is the simplest answer here ...
|Go to Top|