From 9ca2e7f3b212ca7434bb169f7c1b9ac0f8b2b22e Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 17 Jul 2026 23:04:59 +0200 Subject: param ?Client dans newService() et modifyData(), gitignore, config-template --- src/sections/2_service.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/sections/2_service.php') diff --git a/src/sections/2_service.php b/src/sections/2_service.php index e25d677..9ebf303 100644 --- a/src/sections/2_service.php +++ b/src/sections/2_service.php @@ -3,9 +3,7 @@ // // -- SECTION 2: Prestation et devis -- -use Doctrine\ORM\EntityManager; - -function newService($Client): array // $Client est un Client ou null +function newService(?Client $Client = null): array { // fenĂȘtres recherche d'un client $RechercheClient = new zenityEntry(ZenitySetup::$recherche_client['text']); @@ -25,11 +23,11 @@ function newService($Client): array // $Client est un Client ou null // -- partie 1: le client -- - if($Client == null || get_class($Client) !== 'Client') + if(!$Client) { - $Client = Client::getObject($RechercheClient, $ResultatsRechercheClient); // retourne un Client ou 0 + $Client = Client::find($RechercheClient, $ResultatsRechercheClient); // retourne un Client ou 0 //$ResultatsRechercheClient->cleanCommand(); // inutile parce qu'on ne boucle pas dans cette fonction - if($Client === 0) + if(!$Client) { echo "debug: annulation sĂ©lection client\n"; return [0, null]; // menu principal -- cgit v1.2.3