db = $db; } public function process(array $row, int $cnt): void { $temps = []; $temps['code'] = trim($row['service_sw']); $temps['status'] = SWITCHEntity::DEFAULT_STATUS; // Assuming SWITCHEntity has a STATUS_DEFAULT constant if (!$this->db->table('switchinfo')->insert($temps)) { throw new \Exception($this->db->error()['message']); } echo "{$cnt} -> {$temps['code']} SWITCHCODE 완료.\n"; } }