src/Entity/Gos/NewsletterTemplate.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\ContactSegmentationableInterface;
  4. use App\Repository\Gos\NewsletterTemplateRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Doctrine\ORM\Mapping\JoinTable;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. /**
  12.  * @ORM\Entity(repositoryClass=NewsletterTemplateRepository::class)
  13.  * @ORM\HasLifecycleCallbacks
  14.  * @Vich\Uploadable
  15.  */
  16. class NewsletterTemplate implements ContactSegmentationableInterface
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @ORM\Column(type="text", nullable=true)
  30.      */
  31.     private $message;
  32.     /**
  33.      * @ORM\Column(type="text", nullable=true)
  34.      */
  35.     private $messageNewUser;
  36.     /**
  37.      * @ORM\Column(type="datetime")
  38.      */
  39.     private $createdAt;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true)
  42.      */
  43.     private $updatedAt;
  44.     /**
  45.      * @ORM\Column(type="boolean", nullable=true)
  46.      */
  47.     private $isName;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $colorBg;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $colorButton;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $colorFont;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $parameterA;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true)
  66.      */
  67.     private $parameterF;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      */
  71.     private $reginfo;
  72.     /**
  73.      * @ORM\Column(type="string", length=255, nullable=true)
  74.      */
  75.     private $parameterC;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $parameterChc;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity=Newsletter::class, mappedBy="newsletterTemplate")
  82.      */
  83.     private $newsletters;
  84.     /**
  85.      * @ORM\Column(type="string", length=255, nullable=true)
  86.      */
  87.     private $gratisUrl;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      */
  91.     private $sender;
  92.     /**
  93.      * @Vich\UploadableField(mapping="newsletter_gratis_files", fileNameProperty="gratisFilename")
  94.      */
  95.     private $gratis;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private $gratisFilename;
  100.     /**
  101.      * @ORM\Column(type="text", nullable=true)
  102.      */
  103.     private $messageConfirmed;
  104.     /**
  105.      * @ORM\Column(type="text", nullable=true)
  106.      */
  107.     private $messageConfirmedNewUser;
  108.     /**
  109.      * @ORM\ManyToOne(targetEntity=EmailTemplate::class, inversedBy="newsletterTemplates")
  110.      */
  111.     private $emailTemplate;
  112.     /**
  113.      * @ORM\Column(type="string", length=255, nullable=true)
  114.      */
  115.     private $fromEmail;
  116.     /**
  117.      * @ORM\Column(type="string", length=255, nullable=true)
  118.      */
  119.     private $attachmentName;
  120.     /**
  121.      * @ORM\Column(type="boolean", nullable=true)
  122.      */
  123.     private $oneTimePassword;
  124.     /**
  125.      * @ORM\Column(type="text", nullable=true)
  126.      */
  127.     private $oneTimePasswordMessage;
  128.     /**
  129.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  130.      */
  131.     private $isFileNewsletter;
  132.     /**
  133.      * @ORM\OneToOne(targetEntity=LeadReminders::class, cascade={"persist", "remove"})
  134.      */
  135.     private $reminder;
  136.     /**
  137.      * @ORM\Column(type="boolean", nullable=true)
  138.      */
  139.     private $useAlternativeForm;
  140.     /**
  141.      * @ORM\Column(type="boolean", nullable=true, options={"default":1})
  142.      */
  143.     private $hideLastName;
  144.     /**
  145.      * @ORM\OneToMany(targetEntity=LeadFormResponseItem::class, mappedBy="newsletterTemplate")
  146.      */
  147.     private $leadFormResponseItems;
  148.     /**
  149.      * @ORM\OneToMany(targetEntity=NewsletterTemplateWhitelist::class, mappedBy="newsletterTemplate", orphanRemoval=true)
  150.      */
  151.     private $newsletterTemplateWhitelist;
  152.     /**
  153.      * @ORM\Column(type="integer", nullable=true)
  154.      */
  155.     private $emailValidationType;
  156.     /**
  157.      * @ORM\Column(type="string", length=255, nullable=true)
  158.      */
  159.     private $reginfoValidation;
  160.     /**
  161.      * @ORM\ManyToMany(targetEntity=ProductVariant::class, inversedBy="newsletterTemplateValidations")
  162.      */
  163.     private $productVariantsValidation;
  164.     /**
  165.      * @ORM\Column(type="string", length=255, nullable=true)
  166.      */
  167.     private $emailValidationErrorMessage;
  168.     /**
  169.      * @ORM\ManyToMany(targetEntity=Term::class, inversedBy="newsletterTemplates")
  170.      */
  171.     private $terms;
  172.     /**
  173.      * @ORM\OneToOne(targetEntity=LeadFormResponseAddress::class, inversedBy="newsletterTemplate", cascade={"persist", "remove"})
  174.      */
  175.     private $leadFormResponseAddress;
  176.     /**
  177.      * @ORM\OneToOne(targetEntity=LeadFormResponsePosition::class, inversedBy="newsletterTemplate", cascade={"persist", "remove"})
  178.      */
  179.     private $leadFormResponsePosition;
  180.     /**
  181.      * @ORM\ManyToMany(targetEntity=ProductVariant::class)
  182.      * @JoinTable(name="newsletter_template_product_variant_access")
  183.      */
  184.     private $productVariants;
  185.     /**
  186.      * @ORM\ManyToOne(targetEntity=LeadGroup::class, inversedBy="newsletterTemplates")
  187.      */
  188.     private $leadGroup;
  189.     /**
  190.      * @ORM\ManyToMany(targetEntity=ProductVariant::class)
  191.      * @ORM\JoinTable(name="newsletter_template_related_product_variants")
  192.      */
  193.     private $relatedProductVariants;
  194.     /**
  195.      * @ORM\Column(type="string", length=255, nullable=true)
  196.      */
  197.     private $actionNumbers;
  198.     /**
  199.      * @ORM\Column(type="boolean", nullable=true)
  200.      */
  201.     private $requiredNPWZ;
  202.     /**
  203.      * @ORM\Column(type="boolean", options={"default":0})
  204.      */
  205.     private $isPhoneRequired false;
  206.     /**
  207.      * @ORM\Column(type="boolean", options={"default":0})
  208.      */
  209.     private $isPhoneHidden false;
  210.     /**
  211.      * @ORM\Column(type="boolean", nullable=true)
  212.      */
  213.     private $overrideActionNumber;
  214.     /**
  215.      * @ORM\Column(type="string", length=255, nullable=true)
  216.      */
  217.     private $actionNumber;
  218.     /**
  219.      * @ORM\Column(type="text", nullable=true)
  220.      */
  221.     private $legalRule;
  222.     /**
  223.      * @ORM\ManyToMany(targetEntity=SalesManagoTagGroup::class, mappedBy="newsletterTemplate")
  224.      */
  225.     private $salesManagoTagGroups;
  226.     /**
  227.      * @ORM\Column(type="boolean", nullable=true)
  228.      */
  229.     private $useCustomColors;
  230.     /**
  231.      * @ORM\ManyToMany(targetEntity=ContactSegmentation::class)
  232.      */
  233.     private $contactSegmentations;
  234.     public function __construct()
  235.     {
  236.         $this->newsletters                  = new ArrayCollection();
  237.         $this->leadFormResponseItems        = new ArrayCollection();
  238.         $this->newsletterTemplateWhitelist  = new ArrayCollection();
  239.         $this->productVariantsValidation    = new ArrayCollection();
  240.         $this->terms                        = new ArrayCollection();
  241.         $this->productVariants              = new ArrayCollection();
  242.         $this->relatedProductVariants       = new ArrayCollection();
  243.         $this->salesManagoTagGroups         = new ArrayCollection();
  244.         $this->contactSegmentations = new ArrayCollection();
  245.     }
  246.     /** @ORM\PrePersist() */
  247.     public function prePersist()
  248.     {
  249.         $this->createdAt = new \DateTime();
  250.     }
  251.     /** @ORM\PreUpdate() */
  252.     public function preUpdate()
  253.     {
  254.         $this->updatedAt = new \DateTime();
  255.     }
  256.     public function __clone() {
  257.         if ($this->id) {
  258.             $this->id null;
  259.         }
  260.     }
  261.     public function getId(): ?int
  262.     {
  263.         return $this->id;
  264.     }
  265.     public function getName(): ?string
  266.     {
  267.         return $this->name;
  268.     }
  269.     public function setName(string $name): self
  270.     {
  271.         $this->name $name;
  272.         return $this;
  273.     }
  274.     public function getMessage(): ?string
  275.     {
  276.         return $this->message;
  277.     }
  278.     public function setMessage(?string $message): self
  279.     {
  280.         $this->message $message;
  281.         return $this;
  282.     }
  283.     public function getMessageNewUser(): ?string
  284.     {
  285.         return $this->messageNewUser;
  286.     }
  287.     public function setMessageNewUser(?string $messageNewUser): self
  288.     {
  289.         $this->messageNewUser $messageNewUser;
  290.         return $this;
  291.     }
  292.     public function getCreatedAt(): ?\DateTimeInterface
  293.     {
  294.         return $this->createdAt;
  295.     }
  296.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  297.     {
  298.         $this->createdAt $createdAt;
  299.         return $this;
  300.     }
  301.     public function getUpdatedAt(): ?\DateTimeInterface
  302.     {
  303.         return $this->updatedAt;
  304.     }
  305.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  306.     {
  307.         $this->updatedAt $updatedAt;
  308.         return $this;
  309.     }
  310.     public function getIsName(): ?bool
  311.     {
  312.         return $this->isName;
  313.     }
  314.     public function setIsName(?bool $isName): self
  315.     {
  316.         $this->isName $isName;
  317.         return $this;
  318.     }
  319.     public function getColorBg(): ?string
  320.     {
  321.         return $this->colorBg;
  322.     }
  323.     public function setColorBg(?string $colorBg): self
  324.     {
  325.         $this->colorBg $colorBg;
  326.         return $this;
  327.     }
  328.     public function getColorButton(): ?string
  329.     {
  330.         return $this->colorButton;
  331.     }
  332.     public function setColorButton(?string $colorButton): self
  333.     {
  334.         $this->colorButton $colorButton;
  335.         return $this;
  336.     }
  337.     public function getColorFont(): ?string
  338.     {
  339.         return $this->colorFont;
  340.     }
  341.     public function setColorFont(?string $colorFont): self
  342.     {
  343.         $this->colorFont $colorFont;
  344.         return $this;
  345.     }
  346.     public function getParameterA(): ?string
  347.     {
  348.         return $this->parameterA;
  349.     }
  350.     public function setParameterA(?string $parameterA): self
  351.     {
  352.         $this->parameterA $parameterA;
  353.         return $this;
  354.     }
  355.     public function getParameterF(): ?string
  356.     {
  357.         return $this->parameterF;
  358.     }
  359.     public function setParameterF(?string $parameterF): self
  360.     {
  361.         $this->parameterF $parameterF;
  362.         return $this;
  363.     }
  364.     public function getReginfo(): ?string
  365.     {
  366.         return $this->reginfo;
  367.     }
  368.     public function setReginfo(?string $reginfo): self
  369.     {
  370.         $this->reginfo $reginfo;
  371.         return $this;
  372.     }
  373.     public function getParameterC(): ?string
  374.     {
  375.         return $this->parameterC;
  376.     }
  377.     public function setParameterC(?string $parameterC): self
  378.     {
  379.         $this->parameterC $parameterC;
  380.         return $this;
  381.     }
  382.     public function getParameterChc(): ?string
  383.     {
  384.         return $this->parameterChc;
  385.     }
  386.     public function setParameterChc(?string $parameterChc): self
  387.     {
  388.         $this->parameterChc $parameterChc;
  389.         return $this;
  390.     }
  391.     /**
  392.      * @return Collection|Newsletter[]
  393.      */
  394.     public function getNewsletters(): Collection
  395.     {
  396.         return $this->newsletters;
  397.     }
  398.     public function addNewsletter(Newsletter $newsletter): self
  399.     {
  400.         if (!$this->newsletters->contains($newsletter)) {
  401.             $this->newsletters[] = $newsletter;
  402.             $newsletter->setNewsletterTemplate($this);
  403.         }
  404.         return $this;
  405.     }
  406.     public function removeNewsletter(Newsletter $newsletter): self
  407.     {
  408.         if ($this->newsletters->contains($newsletter)) {
  409.             $this->newsletters->removeElement($newsletter);
  410.             // set the owning side to null (unless already changed)
  411.             if ($newsletter->getNewsletterTemplate() === $this) {
  412.                 $newsletter->setNewsletterTemplate(null);
  413.             }
  414.         }
  415.         return $this;
  416.     }
  417.     public function getGratisUrl(): ?string
  418.     {
  419.         return $this->gratisUrl;
  420.     }
  421.     public function setGratisUrl(?string $gratisUrl): self
  422.     {
  423.         $this->gratisUrl $gratisUrl;
  424.         return $this;
  425.     }
  426.     public function getSender(): ?string
  427.     {
  428.         return $this->sender;
  429.     }
  430.     public function setSender(?string $sender): self
  431.     {
  432.         $this->sender $sender;
  433.         return $this;
  434.     }
  435.     public function getGratis():?File
  436.     {
  437.         return $this->gratis;
  438.     }
  439.     public function setGratis(?File $gratis): self
  440.     {
  441.         $this->gratis $gratis;
  442.         if($gratis){
  443.             $this->updatedAt = new \DateTime();
  444.         }
  445.         return $this;
  446.     }
  447.     public function getGratisFilename(): ?string
  448.     {
  449.         return $this->gratisFilename;
  450.     }
  451.     public function setGratisFilename(?string $gratisFilename): self
  452.     {
  453.         $this->gratisFilename $gratisFilename;
  454.         return $this;
  455.     }
  456.     public function getMessageConfirmed(): ?string
  457.     {
  458.         return $this->messageConfirmed;
  459.     }
  460.     public function setMessageConfirmed(?string $messageConfirmed): self
  461.     {
  462.         $this->messageConfirmed $messageConfirmed;
  463.         return $this;
  464.     }
  465.     public function getMessageConfirmedNewUser(): ?string
  466.     {
  467.         return $this->messageConfirmedNewUser;
  468.     }
  469.     public function setMessageConfirmedNewUser(?string $messageConfirmedNewUser): self
  470.     {
  471.         $this->messageConfirmedNewUser $messageConfirmedNewUser;
  472.         return $this;
  473.     }
  474.     public function getEmailTemplate(): ?EmailTemplate
  475.     {
  476.         return $this->emailTemplate;
  477.     }
  478.     public function setEmailTemplate(?EmailTemplate $emailTemplate): self
  479.     {
  480.         $this->emailTemplate $emailTemplate;
  481.         return $this;
  482.     }
  483.     public function getFromEmail(): ?string
  484.     {
  485.         return $this->fromEmail;
  486.     }
  487.     public function setFromEmail(?string $fromEmail): self
  488.     {
  489.         $this->fromEmail $fromEmail;
  490.         return $this;
  491.     }
  492.     public function getAttachmentName(): ?string
  493.     {
  494.         return $this->attachmentName;
  495.     }
  496.     public function setAttachmentName(?string $attachmentName): self
  497.     {
  498.         $this->attachmentName $attachmentName;
  499.         return $this;
  500.     }
  501.     public function getOneTimePassword(): ?bool
  502.     {
  503.         return $this->oneTimePassword;
  504.     }
  505.     public function setOneTimePassword(?bool $oneTimePassword): self
  506.     {
  507.         $this->oneTimePassword $oneTimePassword;
  508.         return $this;
  509.     }
  510.     public function getOneTimePasswordMessage(): ?string
  511.     {
  512.         return $this->oneTimePasswordMessage;
  513.     }
  514.     public function setOneTimePasswordMessage(?string $oneTimePasswordMessage): self
  515.     {
  516.         $this->oneTimePasswordMessage $oneTimePasswordMessage;
  517.         return $this;
  518.     }
  519.     public function getIsFileNewsletter(): ?bool
  520.     {
  521.         return $this->isFileNewsletter;
  522.     }
  523.     public function setIsFileNewsletter(bool $isFileNewsletter): self
  524.     {
  525.         $this->isFileNewsletter $isFileNewsletter;
  526.         return $this;
  527.     }
  528.     public function getReminder(): ?LeadReminders
  529.     {
  530.         return $this->reminder;
  531.     }
  532.     public function setReminder(?LeadReminders $reminder): self
  533.     {
  534.         $this->reminder $reminder;
  535.         return $this;
  536.     }
  537.     public function getUseAlternativeForm(): ?bool
  538.     {
  539.         return $this->useAlternativeForm;
  540.     }
  541.     public function setUseAlternativeForm(?bool $useAlternativeForm): self
  542.     {
  543.         $this->useAlternativeForm $useAlternativeForm;
  544.         return $this;
  545.     }
  546.     public function getHideLastName(): ?bool
  547.     {
  548.         return $this->hideLastName;
  549.     }
  550.     public function setHideLastName(?bool $hideLastName): self
  551.     {
  552.         $this->hideLastName $hideLastName;
  553.         return $this;
  554.     }
  555.     /**
  556.      * @return Collection|LeadFormResponseItem[]
  557.      */
  558.     public function getLeadFormResponseItems(): Collection
  559.     {
  560.         return $this->leadFormResponseItems;
  561.     }
  562.     public function addLeadFormResponseItem(LeadFormResponseItem $leadFormResponseItem): self
  563.     {
  564.         if (!$this->leadFormResponseItems->contains($leadFormResponseItem)) {
  565.             $this->leadFormResponseItems[] = $leadFormResponseItem;
  566.             $leadFormResponseItem->setNewsletterTemplate($this);
  567.         }
  568.         return $this;
  569.     }
  570.     public function removeLeadFormResponseItem(LeadFormResponseItem $leadFormResponseItem): self
  571.     {
  572.         if ($this->leadFormResponseItems->contains($leadFormResponseItem)) {
  573.             $this->leadFormResponseItems->removeElement($leadFormResponseItem);
  574.             // set the owning side to null (unless already changed)
  575.             if ($leadFormResponseItem->getNewsletterTemplate() === $this) {
  576.                 $leadFormResponseItem->setNewsletterTemplate(null);
  577.             }
  578.         }
  579.         return $this;
  580.     }
  581.     /**
  582.      * @return Collection|newsletterTemplateWhitelist[]
  583.      */
  584.     public function getNewsletterTemplateWhitelist(): Collection
  585.     {
  586.         return $this->newsletterTemplateWhitelist;
  587.     }
  588.     public function addNewsletterTemplateWhitelist(newsletterTemplateWhitelist $newsletterTemplateWhitelist): self
  589.     {
  590.         if (!$this->newsletterTemplateWhitelist->contains($newsletterTemplateWhitelist)) {
  591.             $this->newsletterTemplateWhitelist[] = $newsletterTemplateWhitelist;
  592.             $newsletterTemplateWhitelist->setNewsletterTemplate($this);
  593.         }
  594.         return $this;
  595.     }
  596.     public function removeNewsletterTemplateWhitelist(newsletterTemplateWhitelist $newsletterTemplateWhitelist): self
  597.     {
  598.         if ($this->newsletterTemplateWhitelist->contains($newsletterTemplateWhitelist)) {
  599.             $this->newsletterTemplateWhitelist->removeElement($newsletterTemplateWhitelist);
  600.             // set the owning side to null (unless already changed)
  601.             if ($newsletterTemplateWhitelist->getNewsletterTemplate() === $this) {
  602.                 $newsletterTemplateWhitelist->setNewsletterTemplate(null);
  603.             }
  604.         }
  605.         return $this;
  606.     }
  607.     public function getEmailValidationType(): ?int
  608.     {
  609.         return $this->emailValidationType;
  610.     }
  611.     public function setEmailValidationType(?int $emailValidationType): self
  612.     {
  613.         $this->emailValidationType $emailValidationType;
  614.         return $this;
  615.     }
  616.     public function getReginfoValidation(): ?string
  617.     {
  618.         return $this->reginfoValidation;
  619.     }
  620.     public function setReginfoValidation(?string $reginfoValidation): self
  621.     {
  622.         $this->reginfoValidation $reginfoValidation;
  623.         return $this;
  624.     }
  625.     public function addProductVariantsValidation(ProductVariant $productVariantsValidation): self
  626.     {
  627.         if (!$this->productVariantsValidation->contains($productVariantsValidation)) {
  628.             $this->productVariantsValidation[] = $productVariantsValidation;
  629.             $productVariantsValidation->getNewsletterTemplateValidations()->add($this);
  630.         }
  631.         return $this;
  632.     }
  633.     public function removeProductVariantsValidation(ProductVariant $productVariantsValidation): self
  634.     {
  635.         if ($this->productVariantsValidation->contains($productVariantsValidation)) {
  636.             $this->productVariantsValidation->removeElement($productVariantsValidation);
  637.             if ($productVariantsValidation->getNewsletterTemplateValidations()->contains($this)) {
  638.                 $productVariantsValidation->getNewsletterTemplateValidations()->removeElement($this);
  639.             }
  640.         }
  641.         return $this;
  642.     }
  643.     public function getProductVariantsValidation(): Collection
  644.     {
  645.         return $this->productVariantsValidation;
  646.     }
  647.     public function getEmailValidationErrorMessage(): ?string
  648.     {
  649.         return $this->emailValidationErrorMessage;
  650.     }
  651.     public function setEmailValidationErrorMessage(?string $emailValidationErrorMessage): self
  652.     {
  653.         $this->emailValidationErrorMessage $emailValidationErrorMessage;
  654.         return $this;
  655.     }
  656.     /**
  657.      * @return Collection|Term[]
  658.      */
  659.     public function getTerms(): Collection
  660.     {
  661.         return $this->terms;
  662.     }
  663.     public function addTerm(Term $term): self
  664.     {
  665.         if (!$this->terms->contains($term)) {
  666.             $this->terms[] = $term;
  667.         }
  668.         return $this;
  669.     }
  670.     public function removeTerm(Term $term): self
  671.     {
  672.         if ($this->terms->contains($term)) {
  673.             $this->terms->removeElement($term);
  674.         }
  675.         return $this;
  676.     }
  677.     public function getLeadFormResponseAddress(): ?LeadFormResponseAddress
  678.     {
  679.         return $this->leadFormResponseAddress;
  680.     }
  681.     public function setLeadFormResponseAddress(?LeadFormResponseAddress $leadFormResponseAddress): self
  682.     {
  683.         $this->leadFormResponseAddress $leadFormResponseAddress;
  684.         return $this;
  685.     }
  686.     public function getLeadFormResponsePosition(): ?LeadFormResponsePosition
  687.     {
  688.         return $this->leadFormResponsePosition;
  689.     }
  690.     public function setLeadFormResponsePosition(?LeadFormResponsePosition $leadFormResponsePosition): self
  691.     {
  692.         $this->leadFormResponsePosition $leadFormResponsePosition;
  693.         return $this;
  694.     }
  695.     public function isIncludingPosition(): bool
  696.     {
  697.         return $this->getLeadFormResponsePosition() && $this->getLeadFormResponsePosition()->getIncludePosition();
  698.     }
  699.     public function isIncludingAddress(): bool
  700.     {
  701.         return $this->getLeadFormResponseAddress() && $this->getLeadFormResponseAddress()->getIncludeAddress();
  702.     }
  703.     /**
  704.      * @return Collection|ProductVariant[]
  705.      */
  706.     public function getProductVariants(): Collection
  707.     {
  708.         return $this->productVariants;
  709.     }
  710.     public function addProductVariant(ProductVariant $productVariant): self
  711.     {
  712.         if (!$this->productVariants->contains($productVariant)) {
  713.             $this->productVariants[] = $productVariant;
  714.         }
  715.         return $this;
  716.     }
  717.     public function removeProductVariant(ProductVariant $productVariant): self
  718.     {
  719.         if ($this->productVariants->contains($productVariant)) {
  720.             $this->productVariants->removeElement($productVariant);
  721.         }
  722.         return $this;
  723.     }
  724.     public function getLeadGroup(): ?LeadGroup
  725.     {
  726.         return $this->leadGroup;
  727.     }
  728.     public function setLeadGroup(?LeadGroup $leadGroup): self
  729.     {
  730.         $this->leadGroup $leadGroup;
  731.         return $this;
  732.     }
  733.     /**
  734.      * @return Collection|ProductVariant[]
  735.      */
  736.     public function getRelatedProductVariants(): Collection
  737.     {
  738.         return $this->relatedProductVariants;
  739.     }
  740.     public function addRelatedProductVariant(ProductVariant $relatedProductVariant): self
  741.     {
  742.         if (!$this->relatedProductVariants->contains($relatedProductVariant)) {
  743.             $this->relatedProductVariants[] = $relatedProductVariant;
  744.         }
  745.         return $this;
  746.     }
  747.     public function removeRelatedProductVariant(ProductVariant $relatedProductVariant): self
  748.     {
  749.         if ($this->relatedProductVariants->contains($relatedProductVariant)) {
  750.             $this->relatedProductVariants->removeElement($relatedProductVariant);
  751.         }
  752.         return $this;
  753.     }
  754.     public function getActionNumbers(): ?string
  755.     {
  756.         return $this->actionNumbers;
  757.     }
  758.     public function setActionNumbers(?string $actionNumbers): self
  759.     {
  760.         $this->actionNumbers $actionNumbers;
  761.         return $this;
  762.     }
  763.     public function getRequiredNPWZ(): ?bool
  764.     {
  765.         return $this->requiredNPWZ;
  766.     }
  767.     public function setRequiredNPWZ(?bool $requiredNPWZ): self
  768.     {
  769.         $this->requiredNPWZ $requiredNPWZ;
  770.         return $this;
  771.     }
  772.     public function getIsPhoneRequired(): ?bool
  773.     {
  774.         return $this->isPhoneRequired;
  775.     }
  776.     public function setIsPhoneRequired(bool $isPhoneRequired): self
  777.     {
  778.         $this->isPhoneRequired $isPhoneRequired;
  779.         return $this;
  780.     }
  781.     public function isPhoneHidden(): ?bool
  782.     {
  783.         return $this->isPhoneHidden;
  784.     }
  785.     public function setIsPhoneHidden(bool $isPhoneHidden): self
  786.     {
  787.         $this->isPhoneHidden $isPhoneHidden;
  788.         return $this;
  789.     }
  790.     public function getOverrideActionNumber(): ?bool
  791.     {
  792.         return $this->overrideActionNumber;
  793.     }
  794.     public function setOverrideActionNumber(?bool $overrideActionNumber): self
  795.     {
  796.         $this->overrideActionNumber $overrideActionNumber;
  797.         return $this;
  798.     }
  799.     public function getActionNumber(): ?string
  800.     {
  801.         return $this->actionNumber;
  802.     }
  803.     public function setActionNumber(?string $actionNumber): self
  804.     {
  805.         $this->actionNumber $actionNumber;
  806.         return $this;
  807.     }
  808.     public function getLegalRule(): ?string
  809.     {
  810.         return $this->legalRule;
  811.     }
  812.     public function setLegalRule(?string $legalRule): self
  813.     {
  814.         $this->legalRule $legalRule;
  815.         return $this;
  816.     }
  817.     /**
  818.      * @return Collection|SalesManagoTagGroup[]
  819.      */
  820.     public function getSalesManagoTagGroups(): Collection
  821.     {
  822.         return $this->salesManagoTagGroups;
  823.     }
  824.     public function addSalesManagoTagGroup(SalesManagoTagGroup $salesManagoTagGroup): self
  825.     {
  826.         if (!$this->salesManagoTagGroups->contains($salesManagoTagGroup)) {
  827.             $this->salesManagoTagGroups[] = $salesManagoTagGroup;
  828.             $salesManagoTagGroup->addNewsletterTemplate($this);
  829.         }
  830.         return $this;
  831.     }
  832.     public function removeSalesManagoTagGroup(SalesManagoTagGroup $salesManagoTagGroup): self
  833.     {
  834.         if ($this->salesManagoTagGroups->contains($salesManagoTagGroup)) {
  835.             $this->salesManagoTagGroups->removeElement($salesManagoTagGroup);
  836.             $salesManagoTagGroup->removeNewsletterTemplate($this);
  837.         }
  838.         return $this;
  839.     }
  840.     public function getUseCustomColors(): ?bool
  841.     {
  842.         return $this->useCustomColors;
  843.     }
  844.     public function setUseCustomColors(?bool $useCustomColors): self
  845.     {
  846.         $this->useCustomColors $useCustomColors;
  847.         return $this;
  848.     }
  849.     /**
  850.      * @return Collection|ContactSegmentation[]
  851.      */
  852.     public function getContactSegmentations(): Collection
  853.     {
  854.         return $this->contactSegmentations;
  855.     }
  856.     public function addContactSegmentation(ContactSegmentation $contactSegmentation): self
  857.     {
  858.         if (!$this->contactSegmentations->contains($contactSegmentation)) {
  859.             $this->contactSegmentations[] = $contactSegmentation;
  860.         }
  861.         return $this;
  862.     }
  863.     public function removeContactSegmentation(ContactSegmentation $contactSegmentation): self
  864.     {
  865.         if ($this->contactSegmentations->contains($contactSegmentation)) {
  866.             $this->contactSegmentations->removeElement($contactSegmentation);
  867.         }
  868.         return $this;
  869.     }
  870.     public function getSalesmanagoTags(): array
  871.     {
  872.         return array_values(
  873.             $this->contactSegmentations
  874.                 ->map(function (ContactSegmentation $seg) {
  875.                     return $seg->getSalesmanagoTag();
  876.                 })
  877.                 ->filter(function (?string $tag) {
  878.                     return $tag !== null && $tag !== '';
  879.                 })
  880.                 ->toArray()
  881.         );
  882.     }
  883.     public function getSalesManagoSourceTag(): ?string
  884.     {
  885.         return $this->getIsFileNewsletter() ? 'FILE_FORM' 'NEWSLETTER_FORM';
  886.     }
  887. }