I am developing a website using SilverStripe. In my project, I am saving collections of DataObjects into the database. I am looping through the collection and saving each object in the database as below.
foreach ($collection as $item) {
$dbItem = Item::create();
//assign data to $dbItem
$dbItem->write();
}
The problem with the above code is that when I have hundreds of records, it is slow in terms of performance.
In SilverStripe is there a way to bulk insert or create like in Laravel for better performance?