<?php
namespace App\Models;
use CodeIgniter\Model;

class CustomerContactModel extends Model
{
    protected $table         = 'customer_contacts';
    protected $primaryKey    = 'id';
    protected $allowedFields = ['customer_id','name','role_title','email','phone','is_primary','is_billing','sort_order',
        'created_at', 'updated_at', 'deleted_at'];

    public function forCustomer(int $id): array
    {
        return $this->where('customer_id', $id)->orderBy('sort_order')->findAll();
    }
}
