一度に複数のレコードを追加する方法はありますか。通常、一括挿入と呼びます。現在、私は次のことをしています:
foreach ($datalist as $data)
try {
$this->template_id = $data['template_id'];
$this->notifier_id = $data['notifier_id'];
$this->user_id = $data['user_id'];
$this->date_created= date('Y-m-d h:i:s');
$this->save();
return true;
} catch (Kohana_Exception $e) {
return false;
}
}