diff --git a/src/Entity/News.php b/src/Entity/News.php index 3a57eb32cf1b47f95e97dae2933da173ab536c94..899f569c4646a6d871f3a613a0c4c32f57cc84ee 100644 --- a/src/Entity/News.php +++ b/src/Entity/News.php @@ -61,6 +61,10 @@ class News #[ORM\JoinColumn(nullable: false)] private ?Seo $seo = null; + #[ORM\OneToOne(cascade: ['persist', 'remove'])] + #[ORM\JoinColumn(nullable: false)] + private ?File $file = null; + public function __construct() { $this->newsCategories = new ArrayCollection(); @@ -238,4 +242,16 @@ class News return $this; } + + public function getFile(): ?File + { + return $this->file; + } + + public function setFile(File $file): static + { + $this->file = $file; + + return $this; + } }