diff options
author | polo <ordipolo@gmx.fr> | 2023-07-05 01:39:29 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2023-07-05 01:39:29 +0200 |
commit | 9bdfb5196a2ee1cbfc403702e8d2ef88076d366f (patch) | |
tree | 6a92d8011dae746e5fe7a618eb4af2b77e922572 /src/model | |
parent | 884493c1fb985adaaa537c11f4350d940cc68cb1 (diff) | |
download | AppliGestionPHP-9bdfb5196a2ee1cbfc403702e8d2ef88076d366f.zip |
classe Latex "fonctionnelle"
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/Clients.php | 18 | ||||
-rw-r--r-- | src/model/Model.php | 4 | ||||
-rw-r--r-- | src/model/Prestations.php | 22 |
3 files changed, 18 insertions, 26 deletions
diff --git a/src/model/Clients.php b/src/model/Clients.php index 8f460c6..d9dd28d 100644 --- a/src/model/Clients.php +++ b/src/model/Clients.php | |||
@@ -35,27 +35,27 @@ class Clients extends Model | |||
35 | public function setPrenomNom($value) | 35 | public function setPrenomNom($value) |
36 | { | 36 | { |
37 | $this->prenom_nom = (string) $value; | 37 | $this->prenom_nom = (string) $value; |
38 | return($this); | 38 | return $this; |
39 | } | 39 | } |
40 | public function setCodeClient($value) | 40 | public function setCodeClient($value) |
41 | { | 41 | { |
42 | $this->code_client = (string) $value; | 42 | $this->code_client = (string) $value; |
43 | return($this); | 43 | return $this; |
44 | } | 44 | } |
45 | public function setAdresse($value) | 45 | public function setAdresse($value) |
46 | { | 46 | { |
47 | $this->adresse = (string) $value; | 47 | $this->adresse = (string) $value; |
48 | return($this); | 48 | return $this; |
49 | } | 49 | } |
50 | public function setCodePostal($value) | 50 | public function setCodePostal($value) |
51 | { | 51 | { |
52 | $this->code_postal = (string) $value; | 52 | $this->code_postal = (string) $value; |
53 | return($this); | 53 | return $this; |
54 | } | 54 | } |
55 | public function setVille($value) | 55 | public function setVille($value) |
56 | { | 56 | { |
57 | $this->ville = (string) $value; | 57 | $this->ville = (string) $value; |
58 | return($this); | 58 | return $this; |
59 | } | 59 | } |
60 | 60 | ||
61 | 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 |
@@ -69,17 +69,17 @@ class Clients extends Model | |||
69 | $this->telephone = ''; | 69 | $this->telephone = ''; |
70 | echo 'debug: le champ "telephone" ne doit comporter que des nombres, aucun numéro ne sera utilisé' . "\n"; | 70 | echo 'debug: le champ "telephone" ne doit comporter que des nombres, aucun numéro ne sera utilisé' . "\n"; |
71 | } | 71 | } |
72 | return($this); | 72 | return $this; |
73 | } | 73 | } |
74 | public function setCourriel($value) | 74 | public function setCourriel($value) |
75 | { | 75 | { |
76 | $this->courriel = (string) $value; | 76 | $this->courriel = (string) $value; |
77 | return($this); | 77 | return $this; |
78 | } | 78 | } |
79 | public function setApropos($value) | 79 | public function setApropos($value) |
80 | { | 80 | { |
81 | $this->apropos = (string) $value; | 81 | $this->apropos = (string) $value; |
82 | return($this); | 82 | return $this; |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
@@ -106,6 +106,6 @@ class Clients extends Model | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | return($result); | 109 | return $result; |
110 | } | 110 | } |
111 | } | 111 | } |
diff --git a/src/model/Model.php b/src/model/Model.php index 40a9fcb..17d1292 100644 --- a/src/model/Model.php +++ b/src/model/Model.php | |||
@@ -16,7 +16,7 @@ abstract class Model extends DB | |||
16 | // getters | 16 | // getters |
17 | public function getTable(): string | 17 | public function getTable(): string |
18 | { | 18 | { |
19 | return($this->table); | 19 | return $this->table; |
20 | } | 20 | } |
21 | 21 | ||
22 | public function getAll(): array | 22 | public function getAll(): array |
@@ -35,7 +35,7 @@ abstract class Model extends DB | |||
35 | { | 35 | { |
36 | $this->ID = $value; | 36 | $this->ID = $value; |
37 | } | 37 | } |
38 | return($this); | 38 | return $this; |
39 | } | 39 | } |
40 | 40 | ||
41 | public function hydrate(array $data): bool // $data = tableau associatif en entrée: nom_du_champ => valeur | 41 | public function hydrate(array $data): bool // $data = tableau associatif en entrée: nom_du_champ => valeur |
diff --git a/src/model/Prestations.php b/src/model/Prestations.php index 94dd805..22865df 100644 --- a/src/model/Prestations.php +++ b/src/model/Prestations.php | |||
@@ -33,7 +33,7 @@ class Prestations extends Model | |||
33 | { | 33 | { |
34 | return $this->code_presta; | 34 | return $this->code_presta; |
35 | } | 35 | } |
36 | public function getDate(): int | 36 | public function getDate(): int // timestamp unix |
37 | { | 37 | { |
38 | return $this->date; | 38 | return $this->date; |
39 | } | 39 | } |
@@ -48,7 +48,7 @@ class Prestations extends Model | |||
48 | public function setIDClient(int $value) | 48 | public function setIDClient(int $value) |
49 | { | 49 | { |
50 | $this->ID_client = $value; | 50 | $this->ID_client = $value; |
51 | return($this); | 51 | return $this; |
52 | } | 52 | } |
53 | //~ public function setCombientiemeFois(int $value) | 53 | //~ public function setCombientiemeFois(int $value) |
54 | //~ { | 54 | //~ { |
@@ -58,37 +58,29 @@ class Prestations extends Model | |||
58 | public function setCodePresta(string $value) | 58 | public function setCodePresta(string $value) |
59 | { | 59 | { |
60 | $this->code_presta = $value; | 60 | $this->code_presta = $value; |
61 | return($this); | 61 | return $this; |
62 | } | 62 | } |
63 | public function setDate(int $value) | 63 | public function setDate(int $value) |
64 | { | 64 | { |
65 | $this->date = $value; | 65 | $this->date = $value; |
66 | return($this); | 66 | return $this; |
67 | } | 67 | } |
68 | public function setTypePresta(string $value) | 68 | public function setTypePresta(string $value) |
69 | { | 69 | { |
70 | $this->type_presta = $value; | 70 | $this->type_presta = $value; |
71 | return($this); | 71 | return $this; |
72 | } | 72 | } |
73 | public function setModePaiement(string $value) | 73 | public function setModePaiement(string $value) |
74 | { | 74 | { |
75 | $this->mode_paiement = $value; | 75 | $this->mode_paiement = $value; |
76 | return($this); | 76 | return $this; |
77 | } | 77 | } |
78 | public function setCommentaires(string $value) | 78 | public function setCommentaires(string $value) |
79 | { | 79 | { |
80 | $this->commentaires = $value; | 80 | $this->commentaires = $value; |
81 | return($this); | 81 | return $this; |
82 | } | 82 | } |
83 | 83 | ||
84 | //~ protected function combientiemeFois() | ||
85 | //~ { | ||
86 | //~ // on récupère un tableau contenant toutes les prestations d'un client tous types confondus (devis, facture, cesu, location, enregistrement sans vente) | ||
87 | //~ $array = $this->find(['ID_client' => $this->ID_client]); | ||
88 | //~ //$this->combientieme_fois = count($array) + 1; | ||
89 | //~ return count($array) + 1; | ||
90 | //~ } | ||
91 | |||
92 | // code client = année-mois-jour-codeclient-combientièmefois | 84 | // code client = année-mois-jour-codeclient-combientièmefois |
93 | public function makeCodePresta(Dates $Date, string $code_client) | 85 | public function makeCodePresta(Dates $Date, string $code_client) |
94 | { | 86 | { |