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

class CustomerPhoneModel extends Model
{
    protected $table         = 'customer_phones';
    protected $primaryKey    = 'id';
    protected $allowedFields = ['customer_id','type','number','is_primary','sort_order',
        'created_at', 'updated_at', 'deleted_at'];

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