src/Entity/CRM/MailingSendQueue.php line 12

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\MailingSend;
  4. use App\Repository\MailingSendQueueRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\String\ByteString;
  8. #[ORM\Entity(repositoryClassMailingSendQueueRepository::class)]
  9. class MailingSendQueue
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $toEmail null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $toName null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $fromEmail null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $fromName null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $subject null;
  25.     #[ORM\Column(typeTypes::TEXT)]
  26.     private ?string $bodyText null;
  27.     #[ORM\Column(typeTypes::TEXT)]
  28.     private ?string $bodyHtml null;
  29.     #[ORM\Column(nullabletrue)]
  30.     private array $attachements = [];
  31.     #[ORM\Column(length255)]
  32.     private ?string $status null;
  33.     #[ORM\Column]
  34.     private ?int $priority null;
  35.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  36.     private ?\DateTimeInterface $addedDate null;
  37.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  38.     private ?\DateTimeInterface $scheduletAt null;
  39.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  40.     private ?\DateTimeInterface $sentAt null;
  41.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  42.     private ?\DateTimeInterface $updatedAt null;
  43.     #[ORM\Column(length255)]
  44.     private ?string $token null;
  45.     #[ORM\Column]
  46.     private ?bool $interested null;
  47.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  48.     private ?\DateTimeInterface $interestedDate null;
  49.     #[ORM\Column]
  50.     private ?bool $contacted null;
  51.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  52.     private ?\DateTimeInterface $contactedDate null;
  53.     #[ORM\ManyToOne(inversedBy'mailingSendQueues')]
  54.     private ?MailingSend $mailingSend null;
  55.     public function __construct()
  56.     {
  57.         $this->addedDate = new \DateTime();
  58.         $this->status 'pending';
  59.         $this->priority 1;
  60.         $this->token $this->setToken();
  61.         $this->interested false;
  62.         $this->contacted false;
  63.     }
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getToEmail(): ?string
  69.     {
  70.         return $this->toEmail;
  71.     }
  72.     public function setToEmail(string $toEmail): static
  73.     {
  74.         $this->toEmail $toEmail;
  75.         return $this;
  76.     }
  77.     public function getToName(): ?string
  78.     {
  79.         return $this->toName;
  80.     }
  81.     public function setToName(?string $toName): static
  82.     {
  83.         $this->toName $toName;
  84.         return $this;
  85.     }
  86.     public function getFromEmail(): ?string
  87.     {
  88.         return $this->fromEmail;
  89.     }
  90.     public function setFromEmail(string $fromEmail): static
  91.     {
  92.         $this->fromEmail $fromEmail;
  93.         return $this;
  94.     }
  95.     public function getFromName(): ?string
  96.     {
  97.         return $this->fromName;
  98.     }
  99.     public function setFromName(?string $fromName): static
  100.     {
  101.         $this->fromName $fromName;
  102.         return $this;
  103.     }
  104.     public function getSubject(): ?string
  105.     {
  106.         return $this->subject;
  107.     }
  108.     public function setSubject(string $subject): static
  109.     {
  110.         $this->subject $subject;
  111.         return $this;
  112.     }
  113.     public function getBodyText(): ?string
  114.     {
  115.         return $this->bodyText;
  116.     }
  117.     public function setBodyText(string $bodyText): static
  118.     {
  119.         $this->bodyText $bodyText;
  120.         return $this;
  121.     }
  122.     public function getBodyHtml(): ?string
  123.     {
  124.         return $this->bodyHtml;
  125.     }
  126.     public function setBodyHtml(string $bodyHtml): static
  127.     {
  128.         $this->bodyHtml $bodyHtml;
  129.         return $this;
  130.     }
  131.     public function getAttachements(): array
  132.     {
  133.         return $this->attachements;
  134.     }
  135.     public function setAttachements(?array $attachements): static
  136.     {
  137.         $this->attachements $attachements;
  138.         return $this;
  139.     }
  140.     public function getStatus(): ?string
  141.     {
  142.         return $this->status;
  143.     }
  144.     public function setStatus(string $status): static
  145.     {
  146.         $this->status $status;
  147.         return $this;
  148.     }
  149.     public function getPriority(): ?int
  150.     {
  151.         return $this->priority;
  152.     }
  153.     public function setPriority(int $priority): static
  154.     {
  155.         $this->priority $priority;
  156.         return $this;
  157.     }
  158.     public function getAddedDate(): ?\DateTimeInterface
  159.     {
  160.         return $this->addedDate;
  161.     }
  162.     public function setAddedDate(\DateTimeInterface $addedDate): static
  163.     {
  164.         $this->addedDate $addedDate;
  165.         return $this;
  166.     }
  167.     public function getScheduletAt(): ?\DateTimeInterface
  168.     {
  169.         return $this->scheduletAt;
  170.     }
  171.     public function setScheduletAt(\DateTimeInterface $scheduletAt): static
  172.     {
  173.         $this->scheduletAt $scheduletAt;
  174.         return $this;
  175.     }
  176.     public function getSentAt(): ?\DateTimeInterface
  177.     {
  178.         return $this->sentAt;
  179.     }
  180.     public function setSentAt(?\DateTimeInterface $sentAt): static
  181.     {
  182.         $this->sentAt $sentAt;
  183.         return $this;
  184.     }
  185.     public function getUpdatedAt(): ?\DateTimeInterface
  186.     {
  187.         return $this->updatedAt;
  188.     }
  189.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  190.     {
  191.         $this->updatedAt $updatedAt;
  192.         return $this;
  193.     }
  194.     public function getToken(): ?string
  195.     {
  196.         return $this->token;
  197.     }
  198.     public function setToken(): string
  199.     {
  200.         $length 32;
  201.         $urlSafe true;
  202.         // Using Symfony's ByteString for secure random generation
  203.         $token ByteString::fromRandom($length);
  204.         if ($urlSafe) {
  205.             // Convert to URL-safe base64 (removes +, /, = characters)
  206.             $this->token =  base64_encode($token);
  207.             return $this->token;
  208.         }
  209.         // Return as hexadecimal string
  210.         return $token->toString();
  211.     }
  212.     public function isInterested(): ?bool
  213.     {
  214.         return $this->interested;
  215.     }
  216.     public function setInterested(bool $interested): static
  217.     {
  218.         $this->interested $interested;
  219.         return $this;
  220.     }
  221.     public function getInterestedDate(): ?\DateTimeInterface
  222.     {
  223.         return $this->interestedDate;
  224.     }
  225.     public function setInterestedDate(?\DateTimeInterface $interestedDate): static
  226.     {
  227.         $this->interestedDate $interestedDate;
  228.         return $this;
  229.     }
  230.     public function isContacted(): ?bool
  231.     {
  232.         return $this->contacted;
  233.     }
  234.     public function setContacted(bool $contacted): static
  235.     {
  236.         $this->contacted $contacted;
  237.         return $this;
  238.     }
  239.     public function getContactedDate(): ?\DateTimeInterface
  240.     {
  241.         return $this->contactedDate;
  242.     }
  243.     public function setContactedDate(?\DateTimeInterface $contactedDate): static
  244.     {
  245.         $this->contactedDate $contactedDate;
  246.         return $this;
  247.     }
  248.     public function getMailingSend(): ?MailingSend
  249.     {
  250.         return $this->mailingSend;
  251.     }
  252.     public function setMailingSend(?MailingSend $mailingSend): static
  253.     {
  254.         $this->mailingSend $mailingSend;
  255.         return $this;
  256.     }
  257. }