Class tepProduct { public $productsId; public $dades = FALSE; public $model = FALSE; function __construct($productsId) { if(empty($productsId)) { return FALSE; } $this->productsId = $productsId; $this->getDades($productsId); $this->model = (empty($this->dades['products_model']) ? FALSE : $this->dades['products_model']); } public function getDades() { $sql = 'SELECT * FROM products WHERE products_id = '.$this->productsId; $rs = Bd::registre($sql); $this->dades=$rs; return $rs; } }
|