src/Entity/EmailLog.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmailLogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=EmailLogRepository::class)
  7. */
  8. class EmailLog
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\Column(type="string", length=255, nullable=true)
  18. */
  19. private $emailId;
  20. /**
  21. * @ORM\Column(type="string", length=255, nullable=true)
  22. */
  23. private $subject;
  24. /**
  25. * @ORM\Column(type="array", nullable=true)
  26. */
  27. private $fromEmails = [];
  28. /**
  29. * @ORM\Column(type="integer", nullable=true)
  30. */
  31. private $result;
  32. /**
  33. * @ORM\Column(type="array", nullable=true)
  34. */
  35. private $toEmails = [];
  36. /**
  37. * @ORM\Column(type="array", nullable=true)
  38. */
  39. private $ccEmails = [];
  40. /**
  41. * @ORM\Column(type="array", nullable=true)
  42. */
  43. private $bccEmails = [];
  44. /**
  45. * @ORM\Column(type="text", nullable=true)
  46. */
  47. private $body;
  48. /**
  49. * @ORM\Column(type="datetime")
  50. */
  51. private $createts;
  52. public function __construct( \Swift_Events_SendEvent $evt)
  53. {
  54. $this->createts = new \DateTime();
  55. $message = $evt->getMessage();
  56. $this->setBccEmails($message->getBcc());
  57. $this->setBody($message->getBody());
  58. $this->setCcEmails($message->getCc());
  59. $this->setToEmails($message->getTo());
  60. $this->setResult($evt->getResult());
  61. $this->setSubject($message->getSubject());
  62. $this->setEmailId($message->getId());
  63. $this->setFromEmails($message->getFrom());
  64. }
  65. public function getId(): ?int
  66. {
  67. return $this->id;
  68. }
  69. /**
  70. * Get EmailId
  71. *
  72. * @return mixed
  73. */
  74. public function getEmailId()
  75. {
  76. return $this->emailId;
  77. }
  78. /**
  79. * Set EmailId
  80. *
  81. * @param mixed $emailId
  82. */
  83. public function setEmailId( $emailId )
  84. {
  85. $this->emailId = $emailId;
  86. }
  87. public function getSubject(): ?string
  88. {
  89. return $this->subject;
  90. }
  91. public function setSubject(?string $subject): self
  92. {
  93. $this->subject = $subject;
  94. return $this;
  95. }
  96. public function getResult(): ?int
  97. {
  98. return $this->result;
  99. }
  100. public function setResult(?int $result): self
  101. {
  102. $this->result = $result;
  103. return $this;
  104. }
  105. public function getToEmails(): ?array
  106. {
  107. return $this->toEmails;
  108. }
  109. public function setToEmails(?array $toEmails): self
  110. {
  111. $this->toEmails = $toEmails;
  112. return $this;
  113. }
  114. public function getCcEmails(): ?array
  115. {
  116. return $this->ccEmails;
  117. }
  118. public function setCcEmails(?array $ccEmails): self
  119. {
  120. $this->ccEmails = $ccEmails;
  121. return $this;
  122. }
  123. public function getBccEmails(): ?array
  124. {
  125. return $this->bccEmails;
  126. }
  127. public function setBccEmails(?array $bccEmails): self
  128. {
  129. $this->bccEmails = $bccEmails;
  130. return $this;
  131. }
  132. public function getBody(): ?string
  133. {
  134. return $this->body;
  135. }
  136. public function setBody(?string $body): self
  137. {
  138. $this->body = $body;
  139. return $this;
  140. }
  141. public function getCreatets(): ?\DateTimeInterface
  142. {
  143. return $this->createts;
  144. }
  145. public function setCreatets(\DateTimeInterface $createts): self
  146. {
  147. $this->createts = $createts;
  148. return $this;
  149. }
  150. /**
  151. * Get FromEmails
  152. *
  153. * @return mixed
  154. */
  155. public function getFromEmails()
  156. {
  157. return $this->fromEmails;
  158. }
  159. /**
  160. * Set FromEmails
  161. *
  162. * @param mixed $fromEmails
  163. */
  164. public function setFromEmails( $fromEmails )
  165. {
  166. $this->fromEmails = $fromEmails;
  167. }
  168. }