src/Entity/EmailInfo.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmailInfoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=EmailInfoRepository::class)
  9. */
  10. class EmailInfo
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255)
  20. */
  21. private $title;
  22. /**
  23. * @ORM\Column(type="string", length=255)
  24. */
  25. private $subject;
  26. /**
  27. * @ORM\Column(type="string", length=255)
  28. */
  29. private $template;
  30. /**
  31. * @ORM\Column(type="string", length=255)
  32. */
  33. private $entity;
  34. /**
  35. * @ORM\Column(type="json", nullable=true)
  36. */
  37. private $defaultReceivers = [];
  38. /**
  39. * @ORM\ManyToMany(targetEntity=Media::class, inversedBy="emailInfos")
  40. */
  41. private $attachments;
  42. /**
  43. * @ORM\OneToOne(targetEntity=InteractionTemplate::class, inversedBy="emailInfo", cascade={"persist", "remove"})
  44. */
  45. private $interactionTemplate;
  46. public function __construct()
  47. {
  48. $this->attachments = new ArrayCollection();
  49. }
  50. public function getId(): ?int
  51. {
  52. return $this->id;
  53. }
  54. public function getTitle(): ?string
  55. {
  56. return $this->title;
  57. }
  58. public function setTitle(string $title): self
  59. {
  60. $this->title = $title;
  61. return $this;
  62. }
  63. public function getSubject(): ?string
  64. {
  65. return $this->subject;
  66. }
  67. public function setSubject(string $subject): self
  68. {
  69. $this->subject = $subject;
  70. return $this;
  71. }
  72. public function getTemplate(): ?string
  73. {
  74. return $this->template;
  75. }
  76. public function setTemplate(string $template): self
  77. {
  78. $this->template = $template;
  79. return $this;
  80. }
  81. public function getEntity(): ?string
  82. {
  83. return $this->entity;
  84. }
  85. public function setEntity(string $entity): self
  86. {
  87. $this->entity = $entity;
  88. return $this;
  89. }
  90. public function getDefaultReceivers(): ?array
  91. {
  92. return $this->defaultReceivers;
  93. }
  94. public function setDefaultReceivers(?array $defaultReceivers): self
  95. {
  96. $this->defaultReceivers = $defaultReceivers;
  97. return $this;
  98. }
  99. /**
  100. * @return Collection|Media[]
  101. */
  102. public function getAttachments(): Collection
  103. {
  104. return $this->attachments;
  105. }
  106. public function addAttachment(Media $attachment): self
  107. {
  108. if (!$this->attachments->contains($attachment)) {
  109. $this->attachments[] = $attachment;
  110. }
  111. return $this;
  112. }
  113. public function removeAttachment(Media $attachment): self
  114. {
  115. $this->attachments->removeElement($attachment);
  116. return $this;
  117. }
  118. public function getInteractionTemplate(): ?InteractionTemplate
  119. {
  120. return $this->interactionTemplate;
  121. }
  122. public function setInteractionTemplate(?InteractionTemplate $interactionTemplate): self
  123. {
  124. $this->interactionTemplate = $interactionTemplate;
  125. return $this;
  126. }
  127. }