src/Entity/LikedBuilding.php line 9
<?php
namespace App\Entity;
use App\Repository\LikedBuildingRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LikedBuildingRepository::class)]
class LikedBuilding
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'likedBuildings')]
private ?User $user = null;
#[ORM\ManyToOne]
private ?Building $building = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getBuilding(): ?Building
{
return $this->building;
}
public function setBuilding(?Building $building): self
{
$this->building = $building;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}