From 4accca2c57b5f12169afe6a75c74efadd86d835d Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 8 Jul 2025 16:30:10 +0200 Subject: =?UTF-8?q?acc=C3=A8s=20instances=20depuis=20Prestation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/entities/Facture.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/model/entities/Facture.php') diff --git a/src/model/entities/Facture.php b/src/model/entities/Facture.php index 3a8a551..75d1a6e 100644 --- a/src/model/entities/Facture.php +++ b/src/model/entities/Facture.php @@ -13,9 +13,12 @@ class Facture #[ORM\GeneratedValue] private int|null $id = null; - #[ORM\ManyToOne(targetEntity: Prestation::class, cascade: ['persist'])] + //~ #[ORM\ManyToOne(targetEntity: Prestation::class, cascade: ['persist'])] + //~ #[ORM\JoinColumn(name: 'id_presta', referencedColumnName: 'id')] + //~ private Prestation|null $presta = null; + #[ORM\OneToOne(targetEntity: Prestation::class, inversedBy: 'facture', cascade: ['persist'])] #[ORM\JoinColumn(name: 'id_presta', referencedColumnName: 'id')] - private Prestation|null $presta = null; + private ?Prestation $presta = null; #[ORM\Column] private string $taches; @@ -58,6 +61,10 @@ class Facture // n'utiliser get_object_vars() qu'avec une entité parce qu'on maîtrise le nombre de propriétés return get_object_vars($this); } + public function getTotalMainDOeuvre(): float + { + return $this->total_main_d_oeuvre; + } public function getAllWithWindowFields(): array { -- cgit v1.2.3