src/Entity/NewsBookmark.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\NewsBookmarkRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JMS\Serializer\Annotation\Groups;
  7. #[ORM\HasLifecycleCallbacks()]
  8. #[ORM\Entity(repositoryClassNewsBookmarkRepository::class)]
  9. class NewsBookmark
  10. {
  11.     use Timestampable;
  12.     #[Groups(['getNews','getNewsSearch'])]
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[Groups(['getNews','getNewsSearch'])]
  18.     #[ORM\ManyToOne(inversedBy'newsBookmarks')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?News $news null;
  21.     #[ORM\ManyToOne(inversedBy'newsBookmarks')]
  22.     private ?User $user null;
  23.     #[ORM\ManyToOne(inversedBy'newsBookmarks')]
  24.     private ?SchoolYear $year null;
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getNews(): ?News
  30.     {
  31.         return $this->news;
  32.     }
  33.     public function setNews(?News $news): static
  34.     {
  35.         $this->news $news;
  36.         return $this;
  37.     }
  38.     public function getUser(): ?User
  39.     {
  40.         return $this->user;
  41.     }
  42.     public function setUser(?User $user): static
  43.     {
  44.         $this->user $user;
  45.         return $this;
  46.     }
  47.     public function getYear(): ?SchoolYear
  48.     {
  49.         return $this->year;
  50.     }
  51.     public function setYear(?SchoolYear $year): static
  52.     {
  53.         $this->year $year;
  54.         return $this;
  55.     }
  56. }