From f71e0027eb557f785d7c0eea0cc48cd01a32e4d2 Mon Sep 17 00:00:00 2001 From: besbota Date: Thu, 17 Oct 2024 17:17:21 +0200 Subject: [PATCH] MissionCategory.php --- src/Entity/MissionCategory.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Entity/MissionCategory.php b/src/Entity/MissionCategory.php index 3081dc2..862d5a8 100644 --- a/src/Entity/MissionCategory.php +++ b/src/Entity/MissionCategory.php @@ -6,17 +6,16 @@ use App\Repository\MissionCategoryRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: MissionCategoryRepository::class)] -#[ORM\UniqueConstraint(columns: ['mission', 'category'])] class MissionCategory { #[ORM\Id] - #[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'missionCategories')] - #[ORM\Column(type: 'integer')] + #[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'MissionCategory')] + #[ORM\JoinColumn(nullable: false)] private ?Mission $mission = null; #[ORM\Id] - #[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'missionCategories')] - #[ORM\Column(type: 'integer')] + #[ORM\OneToMany(targetEntity: Category::class, mappedBy: 'MissionCategory')] + #[ORM\JoinColumn(nullable: false)] private ?Category $category = null; public function getMission(): ?Mission