motorbike/app/Models/FourchettePrix.php
2025-07-08 16:43:45 +02:00

28 lines
568 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class FourchettePrix extends Model
{
protected $table;
protected $primaryKey = 'id';
protected $allowedFields = ['product_id', 'prix_minimal'];
public function __construct()
{
$this->table = 'fourchette_prix';
parent::__construct();
}
public function getFourchettePrixByProductId($productId)
{
return $this->where('product_id', $productId)->first();
}
public function createFourchettePrix($data)
{
return $this->insert($data);
}
}