<?php

namespace App\Imports;

use App\Models\PlanComptable\SousCompte;
use Maatwebsite\Excel\Concerns\ToModel;

class SousCompteImport implements ToModel
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {
        return new SousCompte([
            'code' => $row[0],
            'intitule' => $row[1],
            'type'  => null,
            'compte_divisionnaire_id' => $row[2],
        ]);
    }
}
