From 9d8133643773912d54fb0c7d86ef04e6acffa8c9 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 25 Feb 2023 02:27:22 +0100 Subject: =?UTF-8?q?lire=20tables,=20modifications=20BDD,=20cr=C3=A9ation?= =?UTF-8?q?=20documents=20et=20enveloppes=20latex,=20suppression=20de=20tr?= =?UTF-8?q?aits.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/Locations.php | 69 ++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'src/model/Locations.php') diff --git a/src/model/Locations.php b/src/model/Locations.php index 21e9b09..8ebf757 100644 --- a/src/model/Locations.php +++ b/src/model/Locations.php @@ -4,48 +4,44 @@ class Locations extends Model { // lecture des données ou hydratation - private $ID_location; - private $nature_bien; - private $modele; - private $valeur; - private $etat_des_lieux_debut; - private $etat_des_lieux_fin; - private $duree_location; - private $loyer_mensuel; - private $total_HT; + protected $ID_presta; + protected $designation; + protected $modele_description; + protected $valeur; + protected $etat_des_lieux_debut; + protected $etat_des_lieux_fin; + protected $duree_location; + protected $loyer_mensuel; + protected $loyers_payes; + protected $caution; - use ModelChildren; + //~ use ModelChildren; - public function __construct(int $client_ID) + public function __construct() { - parent::__construct($client_ID); - $this->type == 'location'; + $this->table = strtolower(__CLASS__); // locations } // setters - public function setIDLocation(int $value) + public function setIDPresta(int $value) { - $this->ID_location = $value; + $this->ID_presta = $value; return($this); } - //~ public function setIDPresta(int $value) - //~ { - //~ $this->ID_presta = $value; - //~ return($this); - //~ } - public function setNatureBien(string $value) + public function setDesignation(string $value) { - $this->nature_bien = $value; + $this->designation = $value; return($this); } - public function setModele(string $value) + public function setModeleDescription(string $value) { - $this->modele = $value; + $this->modele_description = $value; return($this); } - public function setValeur(float $value) + public function setValeur($value) { - $this->valeur = $value; + $value = str_replace(',', '.', $value); + $this->valeur = (float) $value; return($this); } public function setEtatDesLieuxDebut(string $value) @@ -58,19 +54,28 @@ class Locations extends Model $this->etat_des_lieux_fin = $value; return($this); } - public function setDureeLocation(string $value) + public function setDureeLocation($value) { - $this->duree_location = $value; + $value = str_replace(',', '.', $value); + $this->duree_location = (float) $value; return($this); } - public function setlLyerMensuel(float $value) + public function setLoyerMensuel($value) { - $this->loyer_mensuel = $value; + $value = str_replace(',', '.', $value); + $this->loyer_mensuel = (float) $value; return($this); } - public function setTotalHT(float $value) + public function setLoyersPayes($value) { - $this->total_HT = $value; + $value = str_replace(',', '.', $value); + $this->loyers_payes = (float) $value; + return($this); + } + public function setCaution($value) + { + $value = str_replace(',', '.', $value); + $this->caution = (float) $value; return($this); } } -- cgit v1.2.3