src/Entity/LikedBuilding.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LikedBuildingRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassLikedBuildingRepository::class)]
  6. class LikedBuilding
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\ManyToOne(inversedBy'likedBuildings')]
  13.     private ?User $user null;
  14.     #[ORM\ManyToOne]
  15.     private ?Building $building null;
  16.     #[ORM\Column]
  17.     private ?\DateTimeImmutable $createdAt null;
  18.     public function __construct()
  19.     {
  20.         $this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getUser(): ?User
  27.     {
  28.         return $this->user;
  29.     }
  30.     public function setUser(?User $user): self
  31.     {
  32.         $this->user $user;
  33.         return $this;
  34.     }
  35.     public function getBuilding(): ?Building
  36.     {
  37.         return $this->building;
  38.     }
  39.     public function setBuilding(?Building $building): self
  40.     {
  41.         $this->building $building;
  42.         return $this;
  43.     }
  44.     public function getCreatedAt(): ?\DateTimeImmutable
  45.     {
  46.         return $this->createdAt;
  47.     }
  48.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  49.     {
  50.         $this->createdAt $createdAt;
  51.         return $this;
  52.     }
  53. }