From 5ced34359124c74faff9a26227bffb9ce7b15fc3 Mon Sep 17 00:00:00 2001 From: AchillesKal Date: Sat, 13 Apr 2024 13:46:29 +0300 Subject: [PATCH] Fix Blog Tag relation --- src/Entity/BlogPost.php | 2 +- src/Entity/Tag.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Entity/BlogPost.php b/src/Entity/BlogPost.php index 10fa324..03450c8 100644 --- a/src/Entity/BlogPost.php +++ b/src/Entity/BlogPost.php @@ -29,7 +29,7 @@ class BlogPost #[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)] private ?\DateTimeImmutable $publishedAt = null; - #[ORM\ManyToMany(targetEntity: Tag::class, inversedBy: 'tags')] + #[ORM\ManyToMany(targetEntity: Tag::class, inversedBy: 'blogPosts')] private Collection $tags; #[ORM\Column(length: 255, unique: true)] diff --git a/src/Entity/Tag.php b/src/Entity/Tag.php index 67564e6..905a481 100644 --- a/src/Entity/Tag.php +++ b/src/Entity/Tag.php @@ -34,7 +34,6 @@ class Tag #[LimitMenuTags] private bool $isMenu = false; - public function __construct() { $this->blogPosts = new ArrayCollection();