protected function bulkInsertRecords($times) { $this->outletSession->setAutoFlush(false); for ($i = 0; $i < $times; $i++) { $user = new User($i, "Name {$i}"); $this->outletSession->save($user); } $this->outletSession->flush(false); $this->outletSession->setAutoFlush(true); }