motorbike/app/Models/ProductImage.php
2025-08-19 13:53:05 +03:00

29 lines
498 B
PHP

<?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();
}
}