From 45262760a7d575a9d612cc2056e66bf105e43df8 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 2 Sep 2023 11:03:16 +0200 Subject: section 3 ok (manque les prestas non-vendues) --- src/model/Locations.php | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'src/model/Locations.php') diff --git a/src/model/Locations.php b/src/model/Locations.php index e3c9507..ead2727 100644 --- a/src/model/Locations.php +++ b/src/model/Locations.php @@ -24,16 +24,48 @@ class Locations extends Model public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this) { return [ - "Numéro location:" => $this->ID, "Désignation:" => $this->designation, "Description du modèle:" => $this->modele_description, "Valeur:" => $this->valeur, "État des lieux de début:" => $this->etat_des_lieux_debut, "État des lieux de fin:" => $this->etat_des_lieux_fin, "Durée de la location:" => $this->duree_location, - "Loyer Mensuel" => $this->loyer_mensuel, - "Loyers Payés" => $this->loyers_payes, - "Caution" => $this->caution]; + "Loyer Mensuel:" => $this->loyer_mensuel, + "Loyers Payés:" => $this->loyers_payes, + "Caution:" => $this->caution]; + } + public function set(string $entry, string $input) + { + switch($entry) + { + case "Désignation:": + $this->setDesignation($input); + break; + case "Description du modèle:": + $this->setModeleDescription($input); + break; + case "Valeur:": + $this->setValeur($input); + break; + case "État des lieux de début:": + $this->setEtatDesLieuxDebut($input); + break; + case "État des lieux de fin:": + $this->setEtatDesLieuxFin($input); + break; + case "Durée de la location:": + $this->setDureeLocation($input); + break; + case "Loyer Mensuel:": + $this->setLoyerMensuel($input); + break; + case "Loyers Payés:": + $this->setLoyersPayes($input); + break; + case "Caution:": + $this->setCaution($input); + break; + } } // setters -- cgit v1.2.3