<?php
namespace App\Entity;
use App\Repository\AppointmentPersonRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AppointmentPersonRepository::class)]
#[ORM\HasLifecycleCallbacks]
class AppointmentPerson
{
const REVERVATION_VALIDATING = 1;
const REVERVATION_CONFIRMED = 2;
const REVERVATION_CANCELED = 3;
use \App\Traits\EntityDateTimeAbleTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Appointment::class, inversedBy: 'appointmentPerson')]
private ?\App\Entity\Appointment $appointment = null;
#[ORM\ManyToMany(targetEntity: Program::class, inversedBy: 'appointmentPerson')]
private Collection $programs;
#[ORM\ManyToOne(targetEntity: Profile::class, inversedBy: 'appointmentPerson')]
private ?\App\Entity\Profile $profile = null;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $reservation = null;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $isEnded = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $note = null;
public function __construct()
{
$this->programs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getAppointment(): ?Appointment
{
return $this->appointment;
}
public function setAppointment(?Appointment $appointment): self
{
$this->appointment = $appointment;
return $this;
}
/**
* @return Collection<int, Program>
*/
public function getPrograms(): Collection
{
return $this->programs;
}
public function addProgram(Program $program): self
{
if (!$this->programs->contains($program)) {
$this->programs[] = $program;
}
return $this;
}
public function removeProgram(Program $program): self
{
$this->programs->removeElement($program);
return $this;
}
public function getProfile(): ?Profile
{
return $this->profile;
}
public function setProfile(?Profile $profile): self
{
$this->profile = $profile;
return $this;
}
public function getReservation(): ?int
{
return $this->reservation;
}
public function setReservation(?int $reservation): self
{
$this->reservation = $reservation;
return $this;
}
public function getIsEnded(): ?bool
{
return $this->isEnded;
}
public function setIsEnded(?bool $isEnded): self
{
$this->isEnded = $isEnded;
return $this;
}
public function getNote(): ?string
{
return $this->note;
}
public function setNote(?string $note): self
{
$this->note = $note;
return $this;
}
}