From 63365247e23c206bc9eea63a224447543f1ec9b5 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 12 Oct 2026 21:42:42 +0200 Subject: =?UTF-8?q?pr=C3=A9paration=20date=20bulletin=20de=20paie=20des=20?= =?UTF-8?q?CESU,=20relecture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/entities/Devis.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/model/entities/Devis.php') diff --git a/src/model/entities/Devis.php b/src/model/entities/Devis.php index ce2a043..70a3cbf 100644 --- a/src/model/entities/Devis.php +++ b/src/model/entities/Devis.php @@ -38,15 +38,13 @@ class Devis private string $delai_livraison; #[ORM\Column] private string $validite_devis; - #[ORM\Column (options: ['default' => 'non'])] + #[ORM\Column (options: ['default' => 'non'])] // défaut dans le cas d'un requête SQL ignorant ce champ private string $signature_devis = 'non'; public static EntityManager $entityManager; public function __construct(?Prestation $presta = null){ - if($presta != null){ - $this->setPresta($presta); - } + $this->setPresta($presta); } // getters @@ -207,17 +205,16 @@ class Devis return str_replace($search, '', $data); } // à mettre plus tard dans une classe mère - public function hydrate(string $answers) + public function hydrate(string $answers): void { $answers = $this->cleanSpecialChars($answers); // possibilité que $answers devienne une chaine vide if($answers == '') { echo "erreur de Devis::hydrate(), la chaine \$answers est vide.\n"; - return false; + return; } $data_array = explode('|', $answers); // array - //$check = false; if(count($data_array) === 9) // facture normale, "=== 9" = merdique { $this->getPresta()->setModePaiement(''); // sécurité, doctrine plante si "null" @@ -226,7 +223,7 @@ class Devis else { echo "erreur de Devis::hydrate(), le tableau \$data_array n'a pas la taille attendue.\n"; - return false; + return; } //self::$entityManager->persist('Prestation'); -- cgit v1.2.3