src/Entity/CRM/DirectMessage.php line 13

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Task;
  4. use App\Repository\DirectMessageRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassDirectMessageRepository::class)]
  10. class DirectMessage
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  17.     private ?\DateTimeInterface $dateAdded null;
  18.     #[ORM\Column(typeTypes::TEXT)]
  19.     private ?string $title null;
  20.     #[ORM\ManyToOne(inversedBy'directMessagesSent')]
  21.     private ?Admin $senderAdmin null;
  22.     #[ORM\ManyToOne(inversedBy'directMessagesSent')]
  23.     private ?Consultant $senderConsultant null;
  24.     #[ORM\ManyToOne(inversedBy'directMessagesReceived')]
  25.     private ?Admin $receiverAdmin null;
  26.     #[ORM\ManyToOne(inversedBy'directMessagesReceived')]
  27.     private ?Consultant $receiverConsultant null;
  28.     #[ORM\Column]
  29.     private ?bool $shown null;
  30.     #[ORM\Column]
  31.     private ?bool $hiddenAtSender null;
  32.     #[ORM\Column]
  33.     private ?bool $hiddenAtRecipient null;
  34.     #[ORM\OneToMany(mappedBy'directMessage'targetEntityTask::class)]
  35.     private Collection $tasks;
  36.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  37.     private ?\DateTimeInterface $startDate null;
  38.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  39.     private ?\DateTimeInterface $endDate null;
  40.     #[ORM\Column(typeTypes::TEXT)]
  41.     private ?string $content null;
  42.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  43.     private ?string $receiverNote null;
  44.     public function __construct()
  45.     {
  46.         $this->tasks = new ArrayCollection();
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getDateAdded(): ?\DateTimeInterface
  53.     {
  54.         return $this->dateAdded;
  55.     }
  56.     public function setDateAdded(\DateTimeInterface $dateAdded): static
  57.     {
  58.         $this->dateAdded $dateAdded;
  59.         return $this;
  60.     }
  61.     public function getTitle(): ?string
  62.     {
  63.         return $this->title;
  64.     }
  65.     public function setTitle(string $title): static
  66.     {
  67.         $this->title $title;
  68.         return $this;
  69.     }
  70.     public function getSenderAdmin(): ?Admin
  71.     {
  72.         return $this->senderAdmin;
  73.     }
  74.     public function setSenderAdmin(?Admin $senderAdmin): static
  75.     {
  76.         $this->senderAdmin $senderAdmin;
  77.         return $this;
  78.     }
  79.     public function getSenderConsultant(): ?Consultant
  80.     {
  81.         return $this->senderConsultant;
  82.     }
  83.     public function setSenderConsultant(?Consultant $senderConsultant): static
  84.     {
  85.         $this->senderConsultant $senderConsultant;
  86.         return $this;
  87.     }
  88.     public function getReceiverAdmin(): ?Admin
  89.     {
  90.         return $this->receiverAdmin;
  91.     }
  92.     public function setReceiverAdmin(?Admin $receiverAdmin): static
  93.     {
  94.         $this->receiverAdmin $receiverAdmin;
  95.         return $this;
  96.     }
  97.     public function getReceiverConsultant(): ?Consultant
  98.     {
  99.         return $this->receiverConsultant;
  100.     }
  101.     public function setReceiverConsultant(?Consultant $receiverConsultant): static
  102.     {
  103.         $this->receiverConsultant $receiverConsultant;
  104.         return $this;
  105.     }
  106.     public function isShown(): ?bool
  107.     {
  108.         return $this->shown;
  109.     }
  110.     public function setShown(bool $shown): static
  111.     {
  112.         $this->shown $shown;
  113.         return $this;
  114.     }
  115.     public function isHiddenAtSender(): ?bool
  116.     {
  117.         return $this->hiddenAtSender;
  118.     }
  119.     public function setHiddenAtSender(bool $hiddenAtSender): static
  120.     {
  121.         $this->hiddenAtSender $hiddenAtSender;
  122.         return $this;
  123.     }
  124.     public function isHiddenAtRecipient(): ?bool
  125.     {
  126.         return $this->hiddenAtRecipient;
  127.     }
  128.     public function setHiddenAtRecipient(bool $hiddenAtRecipient): static
  129.     {
  130.         $this->hiddenAtRecipient $hiddenAtRecipient;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, Task>
  135.      */
  136.     public function getTasks(): Collection
  137.     {
  138.         return $this->tasks;
  139.     }
  140.     public function addTask(Task $task): static
  141.     {
  142.         if (!$this->tasks->contains($task)) {
  143.             $this->tasks->add($task);
  144.             $task->setDirectMessage($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeTask(Task $task): static
  149.     {
  150.         if ($this->tasks->removeElement($task)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($task->getDirectMessage() === $this) {
  153.                 $task->setDirectMessage(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     public function getStartDate(): ?\DateTimeInterface
  159.     {
  160.         return $this->startDate;
  161.     }
  162.     public function setStartDate(?\DateTimeInterface $startDate): static
  163.     {
  164.         $this->startDate $startDate;
  165.         return $this;
  166.     }
  167.     public function getEndDate(): ?\DateTimeInterface
  168.     {
  169.         return $this->endDate;
  170.     }
  171.     public function setEndDate(\DateTimeInterface $endDate): static
  172.     {
  173.         $this->endDate $endDate;
  174.         return $this;
  175.     }
  176.     public function getContent(): ?string
  177.     {
  178.         return $this->content;
  179.     }
  180.     public function setContent(string $content): static
  181.     {
  182.         $this->content $content;
  183.         return $this;
  184.     }
  185.     public function getReceiverNote(): ?string
  186.     {
  187.         return $this->receiverNote;
  188.     }
  189.     public function setReceiverNote(?string $receiverNote): static
  190.     {
  191.         $this->receiverNote $receiverNote;
  192.         return $this;
  193.     }
  194. }