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/Prestation.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/model/entities/Prestation.php') diff --git a/src/model/entities/Prestation.php b/src/model/entities/Prestation.php index ee9b3c0..e7abd8b 100644 --- a/src/model/entities/Prestation.php +++ b/src/model/entities/Prestation.php @@ -15,7 +15,7 @@ class Prestation #[ORM\ManyToOne(targetEntity: Client::class, cascade: ['persist'])] #[ORM\JoinColumn(name: 'id_client', referencedColumnName: 'id')] - private Client|null $client = null; // type int en SQL et dans la base + private ?Client $client = null; // type int en SQL et dans la base #[ORM\Column] private string $code_presta; @@ -40,12 +40,8 @@ class Prestation public static EntityManager $entityManager; - public function __construct(?Client $client = null) - { - if($client != null) - { - $this->setClient($client); - } + public function __construct(?Client $client = null){ + $this->setClient($client); } // getters @@ -94,8 +90,8 @@ class Prestation // une interface pour ça c'est bien aussi non? public function getFacture(): ?Facture - { - return $this->facture; + { + return $this->facture; } public function getDevis(): ?Devis { @@ -162,14 +158,13 @@ class Prestation //$input->typeToClient(); // on modifie $client ici (merci les références PHP) } - public function set(string $entry, $input) // $input = chaîne ou entier + public function set(string $entry, string|Dates $input): void { - if(gettype($input) === 'string') - { - $input = $this->cleanSpecialChars($input); // possibilité que $input devienne une chaine vide + if(gettype($input) === 'string'){ + $input = $this->cleanSpecialChars($input); // possibilité que $input devienne une chaine vide } - switch($entry) - { + + switch($entry){ // pas de cas "code presta" qui généré par setCodePresta, on peut modifier la date (ici) et le code client (ailleurs) //~ case "Numéro prestation:": //~ $this->setNumeroPresta($input); -- cgit v1.2.3