From 9bdfb5196a2ee1cbfc403702e8d2ef88076d366f Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 5 Jul 2023 01:39:29 +0200 Subject: classe Latex "fonctionnelle" --- src/model/Clients.php | 18 +++++++++--------- src/model/Model.php | 4 ++-- src/model/Prestations.php | 22 +++++++--------------- 3 files changed, 18 insertions(+), 26 deletions(-) (limited to 'src/model') 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 public function setPrenomNom($value) { $this->prenom_nom = (string) $value; - return($this); + return $this; } public function setCodeClient($value) { $this->code_client = (string) $value; - return($this); + return $this; } public function setAdresse($value) { $this->adresse = (string) $value; - return($this); + return $this; } public function setCodePostal($value) { $this->code_postal = (string) $value; - return($this); + return $this; } public function setVille($value) { $this->ville = (string) $value; - return($this); + return $this; } 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 $this->telephone = ''; echo 'debug: le champ "telephone" ne doit comporter que des nombres, aucun numéro ne sera utilisé' . "\n"; } - return($this); + return $this; } public function setCourriel($value) { $this->courriel = (string) $value; - return($this); + return $this; } public function setApropos($value) { $this->apropos = (string) $value; - return($this); + return $this; } @@ -106,6 +106,6 @@ class Clients extends Model } } } - return($result); + return $result; } } 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 // getters public function getTable(): string { - return($this->table); + return $this->table; } public function getAll(): array @@ -35,7 +35,7 @@ abstract class Model extends DB { $this->ID = $value; } - return($this); + return $this; } 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 { return $this->code_presta; } - public function getDate(): int + public function getDate(): int // timestamp unix { return $this->date; } @@ -48,7 +48,7 @@ class Prestations extends Model public function setIDClient(int $value) { $this->ID_client = $value; - return($this); + return $this; } //~ public function setCombientiemeFois(int $value) //~ { @@ -58,37 +58,29 @@ class Prestations extends Model public function setCodePresta(string $value) { $this->code_presta = $value; - return($this); + return $this; } public function setDate(int $value) { $this->date = $value; - return($this); + return $this; } public function setTypePresta(string $value) { $this->type_presta = $value; - return($this); + return $this; } public function setModePaiement(string $value) { $this->mode_paiement = $value; - return($this); + return $this; } public function setCommentaires(string $value) { $this->commentaires = $value; - return($this); + return $this; } - //~ protected function combientiemeFois() - //~ { - //~ // on récupère un tableau contenant toutes les prestations d'un client tous types confondus (devis, facture, cesu, location, enregistrement sans vente) - //~ $array = $this->find(['ID_client' => $this->ID_client]); - //~ //$this->combientieme_fois = count($array) + 1; - //~ return count($array) + 1; - //~ } - // code client = année-mois-jour-codeclient-combientièmefois public function makeCodePresta(Dates $Date, string $code_client) { -- cgit v1.2.3