src/Entity/Gos/Consultant/ConsultantHistory.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Consultant;
  3. use App\Entity\Gos\User;
  4. use App\Repository\Gos\Consultant\ConsultantHistoryRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ConsultantHistoryRepository::class)
  10.  */
  11. class ConsultantHistory extends ConsultantChatBase
  12. {
  13.     /**
  14.      * @ORM\ManyToOne(targetEntity=User::class)
  15.      */
  16.     private $consultant;
  17.     /**
  18.      * @ORM\Column(type="datetime")
  19.      */
  20.     private $waitingFrom;
  21.     /**
  22.      * @ORM\Column(type="datetime", nullable=true)
  23.      */
  24.     private $startedAt;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $comment;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity=ConsultantMessage::class, mappedBy="consultantHistory")
  31.      */
  32.     private $consultantMessages;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity=ConsultantRoomStatus::class)
  35.      * @ORM\JoinColumn(nullable=false)
  36.      */
  37.     private $status;
  38.     public function __construct()
  39.     {
  40.         $this->consultantMessages = new ArrayCollection();
  41.     }
  42.     public function getConsultant(): ?User
  43.     {
  44.         return $this->consultant;
  45.     }
  46.     public function setConsultant(?User $consultant): self
  47.     {
  48.         $this->consultant $consultant;
  49.         return $this;
  50.     }
  51.     public function getWaitingFrom(): ?\DateTimeInterface
  52.     {
  53.         return $this->waitingFrom;
  54.     }
  55.     public function setWaitingFrom(\DateTimeInterface $waitingFrom): self
  56.     {
  57.         $this->waitingFrom $waitingFrom;
  58.         return $this;
  59.     }
  60.     public function getStartedAt(): ?\DateTimeInterface
  61.     {
  62.         return $this->startedAt;
  63.     }
  64.     public function setStartedAt(\DateTimeInterface $startedAt): self
  65.     {
  66.         $this->startedAt $startedAt;
  67.         return $this;
  68.     }
  69.     public function getComment(): ?string
  70.     {
  71.         return $this->comment;
  72.     }
  73.     public function setComment(?string $comment): self
  74.     {
  75.         $this->comment $comment;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection|ConsultantMessage[]
  80.      */
  81.     public function getConsultantMessages(): Collection
  82.     {
  83.         return $this->consultantMessages;
  84.     }
  85.     public function addConsultantMessage(ConsultantMessage $consultantMessage): self
  86.     {
  87.         if (!$this->consultantMessages->contains($consultantMessage)) {
  88.             $this->consultantMessages[] = $consultantMessage;
  89.             $consultantMessage->setConsultantHistory($this);
  90.         }
  91.         return $this;
  92.     }
  93.     public function removeConsultantMessage(ConsultantMessage $consultantMessage): self
  94.     {
  95.         if ($this->consultantMessages->contains($consultantMessage)) {
  96.             $this->consultantMessages->removeElement($consultantMessage);
  97.             // set the owning side to null (unless already changed)
  98.             if ($consultantMessage->getConsultantHistory() === $this) {
  99.                 $consultantMessage->setConsultantHistory(null);
  100.             }
  101.         }
  102.         return $this;
  103.     }
  104.     public function getStatus(): ?ConsultantRoomStatus
  105.     {
  106.         return $this->status;
  107.     }
  108.     public function setStatus(?ConsultantRoomStatus $status): self
  109.     {
  110.         $this->status $status;
  111.         return $this;
  112.     }
  113. }