<?php
namespace App\Entity;
use App\Entity\Traits\Timestampable;
use App\Repository\NewsBookmarkRepository;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\Groups;
#[ORM\HasLifecycleCallbacks()]
#[ORM\Entity(repositoryClass: NewsBookmarkRepository::class)]
class NewsBookmark
{
use Timestampable;
#[Groups(['getNews','getNewsSearch'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Groups(['getNews','getNewsSearch'])]
#[ORM\ManyToOne(inversedBy: 'newsBookmarks')]
#[ORM\JoinColumn(nullable: false)]
private ?News $news = null;
#[ORM\ManyToOne(inversedBy: 'newsBookmarks')]
private ?User $user = null;
#[ORM\ManyToOne(inversedBy: 'newsBookmarks')]
private ?SchoolYear $year = null;
public function getId(): ?int
{
return $this->id;
}
public function getNews(): ?News
{
return $this->news;
}
public function setNews(?News $news): static
{
$this->news = $news;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function getYear(): ?SchoolYear
{
return $this->year;
}
public function setYear(?SchoolYear $year): static
{
$this->year = $year;
return $this;
}
}