src/Entity/CRM/MailingSendQueue.php line 12
<?phpnamespace App\Entity\CRM;use App\Entity\CRM\MailingSend;use App\Repository\MailingSendQueueRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\String\ByteString;#[ORM\Entity(repositoryClass: MailingSendQueueRepository::class)]class MailingSendQueue{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $toEmail = null;#[ORM\Column(length: 255, nullable: true)]private ?string $toName = null;#[ORM\Column(length: 255)]private ?string $fromEmail = null;#[ORM\Column(length: 255, nullable: true)]private ?string $fromName = null;#[ORM\Column(length: 255)]private ?string $subject = null;#[ORM\Column(type: Types::TEXT)]private ?string $bodyText = null;#[ORM\Column(type: Types::TEXT)]private ?string $bodyHtml = null;#[ORM\Column(nullable: true)]private array $attachements = [];#[ORM\Column(length: 255)]private ?string $status = null;#[ORM\Column]private ?int $priority = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $addedDate = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $scheduletAt = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $sentAt = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $updatedAt = null;#[ORM\Column(length: 255)]private ?string $token = null;#[ORM\Column]private ?bool $interested = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $interestedDate = null;#[ORM\Column]private ?bool $contacted = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $contactedDate = null;#[ORM\ManyToOne(inversedBy: 'mailingSendQueues')]private ?MailingSend $mailingSend = null;public function __construct(){$this->addedDate = new \DateTime();$this->status = 'pending';$this->priority = 1;$this->token = $this->setToken();$this->interested = false;$this->contacted = false;}public function getId(): ?int{return $this->id;}public function getToEmail(): ?string{return $this->toEmail;}public function setToEmail(string $toEmail): static{$this->toEmail = $toEmail;return $this;}public function getToName(): ?string{return $this->toName;}public function setToName(?string $toName): static{$this->toName = $toName;return $this;}public function getFromEmail(): ?string{return $this->fromEmail;}public function setFromEmail(string $fromEmail): static{$this->fromEmail = $fromEmail;return $this;}public function getFromName(): ?string{return $this->fromName;}public function setFromName(?string $fromName): static{$this->fromName = $fromName;return $this;}public function getSubject(): ?string{return $this->subject;}public function setSubject(string $subject): static{$this->subject = $subject;return $this;}public function getBodyText(): ?string{return $this->bodyText;}public function setBodyText(string $bodyText): static{$this->bodyText = $bodyText;return $this;}public function getBodyHtml(): ?string{return $this->bodyHtml;}public function setBodyHtml(string $bodyHtml): static{$this->bodyHtml = $bodyHtml;return $this;}public function getAttachements(): array{return $this->attachements;}public function setAttachements(?array $attachements): static{$this->attachements = $attachements;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(string $status): static{$this->status = $status;return $this;}public function getPriority(): ?int{return $this->priority;}public function setPriority(int $priority): static{$this->priority = $priority;return $this;}public function getAddedDate(): ?\DateTimeInterface{return $this->addedDate;}public function setAddedDate(\DateTimeInterface $addedDate): static{$this->addedDate = $addedDate;return $this;}public function getScheduletAt(): ?\DateTimeInterface{return $this->scheduletAt;}public function setScheduletAt(\DateTimeInterface $scheduletAt): static{$this->scheduletAt = $scheduletAt;return $this;}public function getSentAt(): ?\DateTimeInterface{return $this->sentAt;}public function setSentAt(?\DateTimeInterface $sentAt): static{$this->sentAt = $sentAt;return $this;}public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedAt;}public function setUpdatedAt(\DateTimeInterface $updatedAt): static{$this->updatedAt = $updatedAt;return $this;}public function getToken(): ?string{return $this->token;}public function setToken(): string{$length = 32;$urlSafe = true;// Using Symfony's ByteString for secure random generation$token = ByteString::fromRandom($length);if ($urlSafe) {// Convert to URL-safe base64 (removes +, /, = characters)$this->token = base64_encode($token);return $this->token;}// Return as hexadecimal stringreturn $token->toString();}public function isInterested(): ?bool{return $this->interested;}public function setInterested(bool $interested): static{$this->interested = $interested;return $this;}public function getInterestedDate(): ?\DateTimeInterface{return $this->interestedDate;}public function setInterestedDate(?\DateTimeInterface $interestedDate): static{$this->interestedDate = $interestedDate;return $this;}public function isContacted(): ?bool{return $this->contacted;}public function setContacted(bool $contacted): static{$this->contacted = $contacted;return $this;}public function getContactedDate(): ?\DateTimeInterface{return $this->contactedDate;}public function setContactedDate(?\DateTimeInterface $contactedDate): static{$this->contactedDate = $contactedDate;return $this;}public function getMailingSend(): ?MailingSend{return $this->mailingSend;}public function setMailingSend(?MailingSend $mailingSend): static{$this->mailingSend = $mailingSend;return $this;}}