<?php

namespace App\Models;

use CodeIgniter\Model;

class InvoiceItemModel extends Model
{
    protected $table         = 'invoice_items';
    protected $allowedFields = ['invoice_id', 'description', 'quantity', 'unit_price', 'line_total'];

    public function forInvoice(int $invoiceId): array
    {
        return $this->where('invoice_id', $invoiceId)->findAll();
    }
}
