From 79bc73d7985f51f2a6a1b3cb6e0115f59afb2ac4 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 19 Oct 2026 23:42:34 +0200 Subject: =?UTF-8?q?mise=20en=20place=20de=20l'h=C3=A9ritage=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/entities/Prestation.php | 45 ++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'src/model/entities/Prestation.php') diff --git a/src/model/entities/Prestation.php b/src/model/entities/Prestation.php index a0489d3..fe18b70 100644 --- a/src/model/entities/Prestation.php +++ b/src/model/entities/Prestation.php @@ -1,17 +1,30 @@ Devis::class, + 'facture' => Facture::class, + 'cesu' => CESU::class, + 'location' => Location::class, + 'non_vendue' => NonVendue::class +])] +abstract class Prestation { #[ORM\Id] #[ORM\Column(type: 'integer')] #[ORM\GeneratedValue] - private int|null $id = null; + private ?int $id = null; #[ORM\ManyToOne(targetEntity: Client::class, cascade: ['persist'])] #[ORM\JoinColumn(name: 'id_client', referencedColumnName: 'id')] @@ -21,23 +34,11 @@ class Prestation #[ORM\Column(type: 'string', length: 10)] // format 'aaaa-mm-jj' private string $date; #[ORM\Column] - private string $type_presta; - #[ORM\Column] private string $mode_paiement = ''; // non renseigné quand on fait un devis #[ORM\Column] private string $commentaires; - - #[ORM\OneToOne(mappedBy: 'presta', targetEntity: Facture::class)] - private ?facture $facture = null; - #[ORM\OneToOne(mappedBy: 'presta', targetEntity: Devis::class)] - private ?devis $devis; - #[ORM\OneToOne(mappedBy: 'presta', targetEntity: CESU::class)] - private ?cesu $cesu; - #[ORM\OneToOne(mappedBy: 'presta', targetEntity: Location::class)] - private ?location $location; public static EntityManager $entityManager; - public function __construct(?Client $client = null){ $this->setClient($client); @@ -56,10 +57,10 @@ class Prestation { return $this->date; } - public function getTypePresta(): string + /*public function getTypePresta(): string { return $this->type_presta; - } + }*/ public function getModePaiement(): string { return $this->mode_paiement; @@ -124,11 +125,11 @@ class Prestation }*/ } - public function setTypePresta(string $value) // appelée dans la section 2 uniquement, pour la 3 on verra plus tard + /*public function setTypePresta(string $value) // appelée dans la section 2 uniquement, pour la 3 on verra plus tard { $this->type_presta = $value; return $this; - } + }*/ public function setModePaiement(string $value) { $this->mode_paiement = $value; @@ -153,7 +154,7 @@ class Prestation //$input->typeToClient(); // on modifie $client ici (merci les références PHP) } - public function set(string $entry, string $input): void + /*public function set(string $entry, string $input): void { $input = $this->cleanSpecialChars($input); // possibilité que $input devienne une chaine vide @@ -176,7 +177,7 @@ class Prestation $this->setCommentaires($input); break; } - } + }*/ // code presta = année-mois-jour-codeclient-typedepresta-combientièmefois public function setCodePresta(int $increment): Prestation // 0 pour modif, 1 pour nouvelle presta @@ -191,7 +192,7 @@ class Prestation $date_array[1], // mois $date_array[2], // jour $this->client->getCodeClient(), // mise à jour éventuelle - $this->type_presta, + //$this->type_presta, $how_many_times ]; $this->code_presta = implode('-', $array_code); @@ -222,7 +223,7 @@ class Prestation $find_by = ['client' => $Customer->getId()]; if($type != '') { - $find_by['type_presta'] = 'devis'; + //$find_by['type_presta'] = 'devis'; } $PrestaList = $repository->findBy($find_by); -- cgit v1.2.3