<?php
namespace App\Entity;
use App\MDS\GreenPatioBundle\Entity\Reservation;
use App\Repository\GpReminderRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=GpReminderRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class GpReminder
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Reservation::class, inversedBy="gpReminders")
* @ORM\JoinColumn(nullable=false)
*/
private $reservation;
/**
* @ORM\Column(type="datetime")
*/
private $reminderAt;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $createdId;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $updatedId;
/**
* @ORM\Column(type="string", length=255)
*/
private $reminder;
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 getReservation(): ?Reservation
{
return $this->reservation;
}
public function setReservation(?Reservation $reservation): self
{
$this->reservation = $reservation;
return $this;
}
public function getReminderAt(): ?\DateTimeInterface
{
return $this->reminderAt;
}
public function setReminderAt(\DateTimeInterface $reminderAt): self
{
$this->reminderAt = $reminderAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedId(): ?User
{
return $this->createdId;
}
public function setCreatedId(?User $createdId): self
{
$this->createdId = $createdId;
return $this;
}
public function getUpdatedId(): ?User
{
return $this->updatedId;
}
public function setUpdatedId(?User $updatedId): self
{
$this->updatedId = $updatedId;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->createdAt = new \DateTimeImmutable();
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function setUpdatedAtValue()
{
$this->updatedAt = new \DateTimeImmutable();
}
public function getReminder(): ?string
{
return $this->reminder;
}
public function setReminder(string $reminder): self
{
$this->reminder = $reminder;
return $this;
}
}