<?phpnamespace App\Entity;use App\Repository\AppointmentRepository;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: AppointmentRepository::class)]#[ORM\HasLifecycleCallbacks]class Appointment{ const PHONE_PREFIX = '+33'; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\OneToOne(inversedBy: 'appointment')] #[ORM\JoinColumn(nullable: false)] private ?TimeSlot $timeSlot = null; #[ORM\Column(length: 255)] private ?string $lastName = null; #[ORM\Column(length: 255)] private ?string $firstName = null; #[ORM\Column(length: 255)] private ?string $email = null; #[ORM\Column(length: 255, nullable: true)] private ?string $phone = null; #[ORM\Column(length: 255)] private ?string $inscriptionType = null; #[ORM\Column(length: 5)] private ?string $childCount = null; #[ORM\OneToOne(targetEntity: self::class)] private ?self $linkedTo = null; #[ORM\Column(length: 255, nullable: true)] private ?string $undoCode = null; #[ORM\Column(nullable: true)] private ?bool $isMain = null; #[ORM\Column(nullable: true)] private ?array $infos = null; #[ORM\Column(length: 255, nullable: true)] private ?string $reason = null; #[ORM\Column] private ?\DateTimeImmutable $createdAt = null; public function getId(): ?int { return $this->id; } public function getTimeSlot(): ?TimeSlot { return $this->timeSlot; } public function setTimeSlot(TimeSlot $timeSlot): static { $this->timeSlot = $timeSlot; return $this; } public function getLastName(): ?string { return $this->lastName; } public function setLastName(string $lastName): static { $this->lastName = $lastName; return $this; } public function getFirstName(): ?string { return $this->firstName; } public function setFirstName(string $firstName): static { $this->firstName = $firstName; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): static { $this->email = $email; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(?string $phone): static { $this->phone = $phone; return $this; } public function getInscriptionType(): ?string { return $this->inscriptionType; } public function setInscriptionType(string $inscriptionType): static { $this->inscriptionType = $inscriptionType; return $this; } public function getChildCount(): ?string { return $this->childCount; } public function setChildCount(string $childCount): static { $this->childCount = $childCount; return $this; } public function getLinkedTo(): ?self { return $this->linkedTo; } public function setLinkedTo(?self $linkedTo): static { $this->linkedTo = $linkedTo; return $this; } public function getUndoCode(): ?string { return $this->undoCode; } public function setUndoCode(?string $undoCode): static { $this->undoCode = $undoCode; return $this; } public function isIsMain(): ?bool { return $this->isMain; } public function setIsMain(?bool $isMain): static { $this->isMain = $isMain; return $this; } public function getInfos($format = 'array'): mixed { if($format === 'json') { return json_encode($this->infos); } return $this->infos; } public function setInfos(?array $infos): static { $this->infos = $infos; return $this; } public function getReason(): ?string { return $this->reason; } public function setReason(?string $reason): static { $this->reason = $reason; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; }}