From 9c9cda0ac823863c6760d77984ea2ecaf87c52ab Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 16 Jul 2024 05:04:13 +0200 Subject: =?UTF-8?q?renommage=20complet=20des=20ID=20en=20id:=20variables,?= =?UTF-8?q?=20m=C3=A9thodes,=20BDD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/functions.php') diff --git a/src/functions.php b/src/functions.php index e7c2e5b..47cea42 100644 --- a/src/functions.php +++ b/src/functions.php @@ -40,7 +40,7 @@ function enterCustomer($Client): bool unset($input); $Client->create(); // écrire dans la base - $Client->setID(); // sans paramètre, exécute un $this->db->lastInsertId() + $Client->setId(); // sans paramètre, exécute un $this->db->lastInsertId() return true; } @@ -76,7 +76,7 @@ function makeObjectClient() } echo "debug: client sélectionné\n"; - $Client->setID($input); + $Client->setId($input); $Client->hydrate($Client->findById()); return $Client; @@ -100,18 +100,18 @@ function getServices(Clients $Client, string $type = '') { echo "debug: recherche d'une prestation\n"; - // on recherche les ID des prestas dans la table 'prestations' avec 'ID_client' - $Presta = new Prestations($Client->getID()); + // on recherche les ID des prestas dans la table 'prestations' avec 'id_client' + $Presta = new Prestations($Client->getId()); $Presta->setTypePresta($type); - $IDs = $Presta->getIDsByIdClient(); // comportement différent si le type est connu + $IDs = $Presta->getIdsByIdClient(); // comportement différent si le type est connu unset($Presta); // mettres toutes les données dans un tableau $PrestaList = []; foreach($IDs as $id) { - $PrestaList[$id] = new Prestations($Client->getID()); // renseigne 'ID_client' - $PrestaList[$id]->setID($id); // ID de la prestation = clé du tableau + $PrestaList[$id] = new Prestations($Client->getId()); // renseigne 'id_client' + $PrestaList[$id]->setId($id); // ID de la prestation = clé du tableau $PrestaList[$id]->hydrate($PrestaList[$id]->findById()); // données copiés de la table à l'objet } @@ -119,7 +119,7 @@ function getServices(Clients $Client, string $type = '') $entrees = []; foreach($PrestaList as $Presta) { - $id = $Presta->getID(); + $id = $Presta->getId(); $entrees[$id][] = $id; $Date = new Dates((int)$Presta->getDate()); // envoi du timestamp, (int) est là par sécurité $entrees[$id][] = $Date->getDate(); -- cgit v1.2.3