motorbike/app/Models/FourchettePrix.php
2025-08-19 13:53:05 +03: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);
}
}