<?php

namespace App\Libraries\DBMigration\Process;

use CodeIgniter\Database\BaseConnection;

class LineProcess implements MigrationProcessInterface
{
  private $db;
  public function __construct(BaseConnection $db)
  {
    $this->db = $db;
  }
  public function process(array $row, int $cnt): void
  {
    $temps = [];
    // TODO: $temps에 필요한 데이터 매핑 추가
    if (!$this->db->table('lineinfo')->insert($temps)) {
      throw new \Exception($this->db->error()['message']);
    }
    echo "{$cnt} -> {$temps['name']} Line완료.\n";
  }
}
