src/Entity/ClinicCommunicationMethods.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClinicCommunicationMethodsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: ClinicCommunicationMethodsRepository::class)]
  8. class ClinicCommunicationMethods
  9. {
  10. #[ORM\Id]
  11. #[ORM\GeneratedValue]
  12. #[ORM\Column(type: 'integer')]
  13. private $id;
  14. #[ORM\ManyToOne(targetEntity: Clinics::class, inversedBy: 'clinicCommunicationMethods')]
  15. private $clinic;
  16. #[ORM\ManyToOne(targetEntity: CommunicationMethods::class, inversedBy: 'clinicCommunicationMethods')]
  17. private $communicationMethod;
  18. #[ORM\Column(type: 'string', length: 255)]
  19. private $sendTo;
  20. #[ORM\Column(type: 'datetime')]
  21. private $modified;
  22. #[ORM\Column(type: 'datetime')]
  23. private $created;
  24. #[ORM\Column(type: 'boolean', nullable: true)]
  25. private $isActive;
  26. #[ORM\Column(type: 'string', length: 2, nullable: true)]
  27. private $IsoCode;
  28. #[ORM\Column(type: 'string', length: 5, nullable: true)]
  29. private $intlCode;
  30. #[ORM\OneToMany(targetEntity: AvailabilityTracker::class, mappedBy: 'communication')]
  31. private $availabilityTrackers;
  32. #[ORM\Column(type: 'integer', nullable: true)]
  33. private $isDefault;
  34. public function __construct()
  35. {
  36. $date = new \DateTime("now", new \DateTimeZone('Asia/Dubai'));
  37. $this->setModified($date);
  38. if ($this->getCreated() == null)
  39. {
  40. $this->setCreated($date);
  41. }
  42. $this->availabilityTrackers = new ArrayCollection();
  43. }
  44. public function getId(): ?int
  45. {
  46. return $this->id;
  47. }
  48. public function getClinic(): ?Clinics
  49. {
  50. return $this->clinic;
  51. }
  52. public function setClinic(?Clinics $clinic): self
  53. {
  54. $this->clinic = $clinic;
  55. return $this;
  56. }
  57. public function getCommunicationMethod(): ?CommunicationMethods
  58. {
  59. return $this->communicationMethod;
  60. }
  61. public function setCommunicationMethod(?CommunicationMethods $communicationMethod): self
  62. {
  63. $this->communicationMethod = $communicationMethod;
  64. return $this;
  65. }
  66. public function getSendTo(): ?string
  67. {
  68. return $this->sendTo;
  69. }
  70. public function setSendTo(string $sendTo): self
  71. {
  72. $this->sendTo = $sendTo;
  73. return $this;
  74. }
  75. public function getModified(): ?\DateTimeInterface
  76. {
  77. return $this->modified;
  78. }
  79. public function setModified(\DateTimeInterface $modified): self
  80. {
  81. $this->modified = $modified;
  82. return $this;
  83. }
  84. public function getCreated(): ?\DateTimeInterface
  85. {
  86. return $this->created;
  87. }
  88. public function setCreated(\DateTimeInterface $created): self
  89. {
  90. $this->created = $created;
  91. return $this;
  92. }
  93. public function getIsActive(): ?bool
  94. {
  95. return $this->isActive;
  96. }
  97. public function setIsActive(?bool $isActive): self
  98. {
  99. $this->isActive = $isActive;
  100. return $this;
  101. }
  102. public function getIsoCode(): ?string
  103. {
  104. return $this->IsoCode;
  105. }
  106. public function setIsoCode(?string $IsoCode): self
  107. {
  108. $this->IsoCode = $IsoCode;
  109. return $this;
  110. }
  111. public function getIntlCode(): ?string
  112. {
  113. return $this->intlCode;
  114. }
  115. public function setIntlCode(?string $intlCode): self
  116. {
  117. $this->intlCode = $intlCode;
  118. return $this;
  119. }
  120. /**
  121. * @return Collection<int, AvailabilityTracker>
  122. */
  123. public function getAvailabilityTrackers(): Collection
  124. {
  125. return $this->availabilityTrackers;
  126. }
  127. public function addAvailabilityTracker(AvailabilityTracker $availabilityTracker): self
  128. {
  129. if (!$this->availabilityTrackers->contains($availabilityTracker)) {
  130. $this->availabilityTrackers[] = $availabilityTracker;
  131. $availabilityTracker->setCommunication($this);
  132. }
  133. return $this;
  134. }
  135. public function removeAvailabilityTracker(AvailabilityTracker $availabilityTracker): self
  136. {
  137. if ($this->availabilityTrackers->removeElement($availabilityTracker)) {
  138. // set the owning side to null (unless already changed)
  139. if ($availabilityTracker->getCommunication() === $this) {
  140. $availabilityTracker->setCommunication(null);
  141. }
  142. }
  143. return $this;
  144. }
  145. public function getIsDefault(): ?int
  146. {
  147. return $this->isDefault;
  148. }
  149. public function setIsDefault(?int $isDefault): self
  150. {
  151. $this->isDefault = $isDefault;
  152. return $this;
  153. }
  154. }