src/Entity/LastViewedBuilding.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LastViewedBuildingRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassLastViewedBuildingRepository::class)]
  6. class LastViewedBuilding
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private ?int $id null;
  12.     #[ORM\ManyToOne(targetEntityUser::class)]
  13.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  14.     private ?User $user null;
  15.     #[ORM\ManyToOne(targetEntityBuilding::class)]
  16.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  17.     private ?Building $building null;
  18.     #[ORM\Column(type'datetime_immutable')]
  19.     private ?\DateTimeImmutable $viewedAt null;
  20.     public function getId(): ?int
  21.     {
  22.         return $this->id;
  23.     }
  24.     public function getUser(): ?User
  25.     {
  26.         return $this->user;
  27.     }
  28.     public function setUser(?User $user): self
  29.     {
  30.         $this->user $user;
  31.         return $this;
  32.     }
  33.     public function getBuilding(): ?Building
  34.     {
  35.         return $this->building;
  36.     }
  37.     public function setBuilding(?Building $building): self
  38.     {
  39.         $this->building $building;
  40.         return $this;
  41.     }
  42.     public function getViewedAt(): ?\DateTimeImmutable
  43.     {
  44.         return $this->viewedAt;
  45.     }
  46.     public function setViewedAt(\DateTimeImmutable $viewedAt): self
  47.     {
  48.         $this->viewedAt $viewedAt;
  49.         return $this;
  50.     }
  51. }