src/Entity/CRM/MailingSend.php line 12

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