<?php

namespace App\Models;

use CodeIgniter\Model;

final class ProductImage extends Model
{
    protected $table = 'image_product';
    protected $allowedFields = [
        'product_id', 'images'
    ];

    public function create($data)
    {
        return $this->insert($data);
    }

    public function getAll($id)
    {
        return $this->where('product_id', $id)->findAll();
    }

    public function deleteOne(int $id)
    {
        return $this->where('id', $id)->delete();
    }
}
