<?phpnamespace App\Entity\Gos\Consultant;use App\Entity\Gos\User;use App\Repository\Gos\Consultant\ConsultantHistoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ConsultantHistoryRepository::class) */class ConsultantHistory extends ConsultantChatBase{ /** * @ORM\ManyToOne(targetEntity=User::class) */ private $consultant; /** * @ORM\Column(type="datetime") */ private $waitingFrom; /** * @ORM\Column(type="datetime", nullable=true) */ private $startedAt; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $comment; /** * @ORM\OneToMany(targetEntity=ConsultantMessage::class, mappedBy="consultantHistory") */ private $consultantMessages; /** * @ORM\ManyToOne(targetEntity=ConsultantRoomStatus::class) * @ORM\JoinColumn(nullable=false) */ private $status; public function __construct() { $this->consultantMessages = new ArrayCollection(); } public function getConsultant(): ?User { return $this->consultant; } public function setConsultant(?User $consultant): self { $this->consultant = $consultant; return $this; } public function getWaitingFrom(): ?\DateTimeInterface { return $this->waitingFrom; } public function setWaitingFrom(\DateTimeInterface $waitingFrom): self { $this->waitingFrom = $waitingFrom; return $this; } public function getStartedAt(): ?\DateTimeInterface { return $this->startedAt; } public function setStartedAt(\DateTimeInterface $startedAt): self { $this->startedAt = $startedAt; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): self { $this->comment = $comment; return $this; } /** * @return Collection|ConsultantMessage[] */ public function getConsultantMessages(): Collection { return $this->consultantMessages; } public function addConsultantMessage(ConsultantMessage $consultantMessage): self { if (!$this->consultantMessages->contains($consultantMessage)) { $this->consultantMessages[] = $consultantMessage; $consultantMessage->setConsultantHistory($this); } return $this; } public function removeConsultantMessage(ConsultantMessage $consultantMessage): self { if ($this->consultantMessages->contains($consultantMessage)) { $this->consultantMessages->removeElement($consultantMessage); // set the owning side to null (unless already changed) if ($consultantMessage->getConsultantHistory() === $this) { $consultantMessage->setConsultantHistory(null); } } return $this; } public function getStatus(): ?ConsultantRoomStatus { return $this->status; } public function setStatus(?ConsultantRoomStatus $status): self { $this->status = $status; return $this; }}