diff options
Diffstat (limited to 'src/model/Clients.php')
-rw-r--r-- | src/model/Clients.php | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/model/Clients.php b/src/model/Clients.php index 9661562..d841451 100644 --- a/src/model/Clients.php +++ b/src/model/Clients.php | |||
@@ -8,23 +8,19 @@ class Clients extends Model | |||
8 | protected $prenom_nom; | 8 | protected $prenom_nom; |
9 | protected $code_client; | 9 | protected $code_client; |
10 | protected $adresse; | 10 | protected $adresse; |
11 | protected $code_postal; | ||
12 | protected $ville; | ||
11 | protected $telephone; | 13 | protected $telephone; |
12 | protected $courriel; | 14 | protected $courriel; |
13 | protected $commentaires; | 15 | protected $apropos; |
14 | 16 | ||
15 | use ModelChildren; // pour hydrateFromForm() | 17 | //~ use ModelChildren; |
16 | 18 | ||
17 | public function __construct() | 19 | public function __construct() |
18 | { | 20 | { |
19 | $this->table = 'clients'; // à mettre dans ModelChildren | 21 | $this->table = strtolower(__CLASS__); // clients |
20 | } | 22 | } |
21 | 23 | ||
22 | //~ public function set(string $variable, $value) | ||
23 | //~ { | ||
24 | //~ $this->$variable = $value; | ||
25 | //~ return($this); | ||
26 | //~ } | ||
27 | |||
28 | // getters | 24 | // getters |
29 | public function getID(): int | 25 | public function getID(): int |
30 | { | 26 | { |
@@ -36,8 +32,6 @@ class Clients extends Model | |||
36 | } | 32 | } |
37 | 33 | ||
38 | // setters | 34 | // setters |
39 | //~ public function setID() -> dans le trait ModelChildren | ||
40 | |||
41 | public function setPrenomNom($value) | 35 | public function setPrenomNom($value) |
42 | { | 36 | { |
43 | $this->prenom_nom = (string) $value; | 37 | $this->prenom_nom = (string) $value; |
@@ -53,6 +47,17 @@ class Clients extends Model | |||
53 | $this->adresse = (string) $value; | 47 | $this->adresse = (string) $value; |
54 | return($this); | 48 | return($this); |
55 | } | 49 | } |
50 | public function setCodePostal($value) | ||
51 | { | ||
52 | $this->code_postal = (string) $value; | ||
53 | return($this); | ||
54 | } | ||
55 | public function setVille($value) | ||
56 | { | ||
57 | $this->ville = (string) $value; | ||
58 | return($this); | ||
59 | } | ||
60 | |||
56 | public function setTelephone($value) // chaine parce que zenity renvoie une chaine et parce qu'on garde le 0 au début | 61 | public function setTelephone($value) // chaine parce que zenity renvoie une chaine et parce qu'on garde le 0 au début |
57 | { | 62 | { |
58 | if(is_numeric($value)) | 63 | if(is_numeric($value)) |
@@ -71,9 +76,9 @@ class Clients extends Model | |||
71 | $this->courriel = (string) $value; | 76 | $this->courriel = (string) $value; |
72 | return($this); | 77 | return($this); |
73 | } | 78 | } |
74 | public function setCommentaires($value) | 79 | public function setApropos($value) |
75 | { | 80 | { |
76 | $this->commentaires = (string) $value; | 81 | $this->apropos = (string) $value; |
77 | return($this); | 82 | return($this); |
78 | } | 83 | } |
79 | 84 | ||