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/3_modify_data.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/sections/3_modify_data.php') diff --git a/src/sections/3_modify_data.php b/src/sections/3_modify_data.php index 00fe220..607638b 100644 --- a/src/sections/3_modify_data.php +++ b/src/sections/3_modify_data.php @@ -5,9 +5,7 @@ require('3-1_windows.php'); -use Doctrine\ORM\EntityManager; - -function modifyData($Client): array +function modifyData(?Client $Client = null): array { // -- partie 1: rechercher un client -- @@ -19,12 +17,11 @@ function modifyData($Client): array $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); $Calendrier = new ZenityCalendar(ZenitySetup::$calendar['section3']); - if($Client == null || get_class($Client) !== 'Client') // étape sautable + if(!$Client) { - $Client = Client::getObject($RechercheClient, $ResultatsRechercheClient); // = 0 ou type "Client" + $Client = Client::find($RechercheClient, $ResultatsRechercheClient); //$ResultatsRechercheClient->cleanCommand(); // inutile parce qu'on ne boucle pas dans cette fonction - //if(!is_object($Client) || !get_class($Client) == 'Client') - if($Client === 0) + if(!$Client) { echo "debug: annulation sélection client\n"; return [0, null]; // menu principal -- cgit v1.2.3