src/Entity/CRM/MailTemplate.php line 13
<?phpnamespace App\Entity\CRM;use App\Repository\MailTemplateRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: MailTemplateRepository::class)]class MailTemplate{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(type: Types::TEXT)]private ?string $html = null;#[ORM\Column(length: 255)]private ?string $subject = null;#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]private array $attachment = [];#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]private array $variable = [];#[ORM\OneToOne(inversedBy: 'mailTemplate', cascade: ['persist', 'remove'])]private ?MailAction $action = null;#[Vich\UploadableField(mapping: 'attachments', fileNameProperty: 'fileName', size: 'imageSize')]#[ORM\OneToMany(mappedBy: 'mailTemplate', targetEntity: MailAttachment::class, cascade: ['persist', 'remove'],orphanRemoval: true)]private Collection $mailAttachments;#[ORM\Column]private ?bool $isActive = null;#[ORM\OneToMany(mappedBy: 'mailTemplate', targetEntity: MailQueue::class)]private Collection $mailQueues;public function __construct(){$this->mailAttachments = new ArrayCollection();$this->mailQueues = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getHtml(): ?string{return $this->html;}public function setHtml(string $html): self{$this->html = $html;return $this;}public function getSubject(): ?string{return $this->subject;}public function setSubject(string $subject): self{$this->subject = $subject;return $this;}public function getAttachment(): array{return $this->attachment;}public function setAttachment(?array $attachment): self{$this->attachment = $attachment;return $this;}public function getVariable(): array{return $this->variable;}public function setVariable(?array $variable): self{$this->variable = $variable;return $this;}public function getAction(): ?MailAction{return $this->action;}public function setAction(?MailAction $action): self{$this->action = $action;return $this;}/*** @return Collection<int, MailAttachment>*/public function getMailAttachments(): Collection{return $this->mailAttachments;}public function addMailAttachment(MailAttachment $mailAttachment): static{if (!$this->mailAttachments->contains($mailAttachment)) {$this->mailAttachments->add($mailAttachment);$mailAttachment->setMailTemplate($this);}return $this;}public function removeMailAttachment(MailAttachment $mailAttachment): static{if ($this->mailAttachments->removeElement($mailAttachment)) {// set the owning side to null (unless already changed)if ($mailAttachment->getMailTemplate() === $this) {$mailAttachment->setMailTemplate(null);}}return $this;}public function isIsActive(): ?bool{return $this->isActive;}public function setIsActive(bool $isActive): static{$this->isActive = $isActive;return $this;}/*** @return Collection<int, MailQueue>*/public function getMailQueues(): Collection{return $this->mailQueues;}public function addMailQueue(MailQueue $mailQueue): static{if (!$this->mailQueues->contains($mailQueue)) {$this->mailQueues->add($mailQueue);$mailQueue->setMailTemplate($this);}return $this;}public function removeMailQueue(MailQueue $mailQueue): static{if ($this->mailQueues->removeElement($mailQueue)) {// set the owning side to null (unless already changed)if ($mailQueue->getMailTemplate() === $this) {$mailQueue->setMailTemplate(null);}}return $this;}}