I need to move outside a loop the $model->save()
sentence, by example:
foreach ($nodes as $i => $node) {
$model = new Singer();
$model->name = $node['name'];
$model->birthDate = $node['birthDate'];
$model->save();
}
There is no way to save the model outside the loop? I mean if there is 100000 records in $nodes
the save method will be executed 100000 times??
Thank you!