diff options
Diffstat (limited to 'src/model/entities/Location.php')
-rw-r--r-- | src/model/entities/Location.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/model/entities/Location.php b/src/model/entities/Location.php index 7ce6f0d..b3c2f8a 100644 --- a/src/model/entities/Location.php +++ b/src/model/entities/Location.php | |||
@@ -13,9 +13,12 @@ class Location | |||
13 | #[ORM\GeneratedValue] | 13 | #[ORM\GeneratedValue] |
14 | private int|null $id = null; | 14 | private int|null $id = null; |
15 | 15 | ||
16 | #[ORM\ManyToOne(targetEntity: Prestation::class, cascade: ['persist'])] | 16 | //~ #[ORM\ManyToOne(targetEntity: Prestation::class, cascade: ['persist'])] |
17 | //~ #[ORM\JoinColumn(name: 'id_presta', referencedColumnName: 'id')] | ||
18 | //~ private Prestation|null $presta = null; | ||
19 | #[ORM\OneToOne(targetEntity: Prestation::class, inversedBy: 'location', cascade: ['persist'])] | ||
17 | #[ORM\JoinColumn(name: 'id_presta', referencedColumnName: 'id')] | 20 | #[ORM\JoinColumn(name: 'id_presta', referencedColumnName: 'id')] |
18 | private Prestation|null $presta = null; | 21 | private ?Prestation $presta = null; |
19 | 22 | ||
20 | #[ORM\Column] | 23 | #[ORM\Column] |
21 | protected string $designation; | 24 | protected string $designation; |
@@ -51,6 +54,14 @@ class Location | |||
51 | { | 54 | { |
52 | return $this->presta; | 55 | return $this->presta; |
53 | } | 56 | } |
57 | public function getLoyer(): float | ||
58 | { | ||
59 | return $this->loyer_hebdo; | ||
60 | } | ||
61 | public function getLoyersPayes(): int | ||
62 | { | ||
63 | return $this->loyers_payes; | ||
64 | } | ||
54 | public function getAll(): array | 65 | public function getAll(): array |
55 | { | 66 | { |
56 | // n'utiliser get_object_vars() qu'avec une entité parce qu'on maîtrise le nombre de propriétés | 67 | // n'utiliser get_object_vars() qu'avec une entité parce qu'on maîtrise le nombre de propriétés |