src/Entity/CRM/MailingSend.php line 14

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\MailingSendQueue;
  4. use App\Entity\CRM\MailMessage;
  5. use App\Repository\MailingSendRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassMailingSendRepository::class)]
  11. class MailingSend
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $subject null;
  19.     #[ORM\ManyToOne(inversedBy'mailingSends')]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?MailMessage $mailMessage null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?string $mailGroup null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  25.     private ?\DateTimeInterface $sendDate null;
  26.     #[ORM\Column]
  27.     private ?bool $sended null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $sendType null;
  30.     #[ORM\OneToMany(mappedBy'mailingSend'targetEntityMailingSendQueue::class)]
  31.     private Collection $mailingSendQueues;
  32.     public function __construct()
  33.     {
  34.         $this->mailingSendQueues = new ArrayCollection();
  35.         $this->sended false;
  36.     }
  37.     public function __toString(): string
  38.     {
  39.         return $this->id.' - '.$this->subject.' - '.$this->mailGroup;
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getSubject(): ?string
  46.     {
  47.         return $this->subject;
  48.     }
  49.     public function setSubject(string $subject): static
  50.     {
  51.         $this->subject $subject;
  52.         return $this;
  53.     }
  54.     public function getMailMessage(): ?MailMessage
  55.     {
  56.         return $this->mailMessage;
  57.     }
  58.     public function setMailMessage(?MailMessage $mailMessage): static
  59.     {
  60.         $this->mailMessage $mailMessage;
  61.         return $this;
  62.     }
  63.     public function getMailGroup(): ?string
  64.     {
  65.         return $this->mailGroup;
  66.     }
  67.     public function setMailGroup(string $mailGroup): static
  68.     {
  69.         $this->mailGroup $mailGroup;
  70.         return $this;
  71.     }
  72.     public function getSendDate(): ?\DateTimeInterface
  73.     {
  74.         return $this->sendDate;
  75.     }
  76.     public function setSendDate(?\DateTimeInterface $sendDate): static
  77.     {
  78.         $this->sendDate $sendDate;
  79.         return $this;
  80.     }
  81.     public function isSended(): ?bool
  82.     {
  83.         return $this->sended;
  84.     }
  85.     public function setSended(bool $sended): static
  86.     {
  87.         $this->sended $sended;
  88.         return $this;
  89.     }
  90.     public function getSendType(): ?string
  91.     {
  92.         return $this->sendType;
  93.     }
  94.     public function setSendType(string $sendType): static
  95.     {
  96.         $this->sendType $sendType;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, MailingSendQueue>
  101.      */
  102.     public function getMailingSendQueues(): Collection
  103.     {
  104.         return $this->mailingSendQueues;
  105.     }
  106.     public function addMailingSendQueue(MailingSendQueue $mailingSendQueue): static
  107.     {
  108.         if (!$this->mailingSendQueues->contains($mailingSendQueue)) {
  109.             $this->mailingSendQueues->add($mailingSendQueue);
  110.             $mailingSendQueue->setMailingSend($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeMailingSendQueue(MailingSendQueue $mailingSendQueue): static
  115.     {
  116.         if ($this->mailingSendQueues->removeElement($mailingSendQueue)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($mailingSendQueue->getMailingSend() === $this) {
  119.                 $mailingSendQueue->setMailingSend(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124. }