summaryrefslogtreecommitdiff
path: root/src/model/Locations.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/Locations.php')
-rw-r--r--src/model/Locations.php69
1 files changed, 37 insertions, 32 deletions
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 @@
4class Locations extends Model 4class Locations extends Model
5{ 5{
6 // lecture des données ou hydratation 6 // lecture des données ou hydratation
7 private $ID_location; 7 protected $ID_presta;
8 private $nature_bien; 8 protected $designation;
9 private $modele; 9 protected $modele_description;
10 private $valeur; 10 protected $valeur;
11 private $etat_des_lieux_debut; 11 protected $etat_des_lieux_debut;
12 private $etat_des_lieux_fin; 12 protected $etat_des_lieux_fin;
13 private $duree_location; 13 protected $duree_location;
14 private $loyer_mensuel; 14 protected $loyer_mensuel;
15 private $total_HT; 15 protected $loyers_payes;
16 protected $caution;
16 17
17 use ModelChildren; 18 //~ use ModelChildren;
18 19
19 public function __construct(int $client_ID) 20 public function __construct()
20 { 21 {
21 parent::__construct($client_ID); 22 $this->table = strtolower(__CLASS__); // locations
22 $this->type == 'location';
23 } 23 }
24 24
25 // setters 25 // setters
26 public function setIDLocation(int $value) 26 public function setIDPresta(int $value)
27 { 27 {
28 $this->ID_location = $value; 28 $this->ID_presta = $value;
29 return($this); 29 return($this);
30 } 30 }
31 //~ public function setIDPresta(int $value) 31 public function setDesignation(string $value)
32 //~ {
33 //~ $this->ID_presta = $value;
34 //~ return($this);
35 //~ }
36 public function setNatureBien(string $value)
37 { 32 {
38 $this->nature_bien = $value; 33 $this->designation = $value;
39 return($this); 34 return($this);
40 } 35 }
41 public function setModele(string $value) 36 public function setModeleDescription(string $value)
42 { 37 {
43 $this->modele = $value; 38 $this->modele_description = $value;
44 return($this); 39 return($this);
45 } 40 }
46 public function setValeur(float $value) 41 public function setValeur($value)
47 { 42 {
48 $this->valeur = $value; 43 $value = str_replace(',', '.', $value);
44 $this->valeur = (float) $value;
49 return($this); 45 return($this);
50 } 46 }
51 public function setEtatDesLieuxDebut(string $value) 47 public function setEtatDesLieuxDebut(string $value)
@@ -58,19 +54,28 @@ class Locations extends Model
58 $this->etat_des_lieux_fin = $value; 54 $this->etat_des_lieux_fin = $value;
59 return($this); 55 return($this);
60 } 56 }
61 public function setDureeLocation(string $value) 57 public function setDureeLocation($value)
62 { 58 {
63 $this->duree_location = $value; 59 $value = str_replace(',', '.', $value);
60 $this->duree_location = (float) $value;
64 return($this); 61 return($this);
65 } 62 }
66 public function setlLyerMensuel(float $value) 63 public function setLoyerMensuel($value)
67 { 64 {
68 $this->loyer_mensuel = $value; 65 $value = str_replace(',', '.', $value);
66 $this->loyer_mensuel = (float) $value;
69 return($this); 67 return($this);
70 } 68 }
71 public function setTotalHT(float $value) 69 public function setLoyersPayes($value)
72 { 70 {
73 $this->total_HT = $value; 71 $value = str_replace(',', '.', $value);
72 $this->loyers_payes = (float) $value;
73 return($this);
74 }
75 public function setCaution($value)
76 {
77 $value = str_replace(',', '.', $value);
78 $this->caution = (float) $value;
74 return($this); 79 return($this);
75 } 80 }
76} 81}