src/Entity/Gos/FastLeadTemplate.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\ContactSegmentationableInterface;
  4. use App\Repository\Gos\FastLeadTemplateRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FastLeadTemplateRepository::class)
  10.  */
  11. class FastLeadTemplate implements ContactSegmentationableInterface
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     private $searchType;
  27.     /**
  28.      * @ORM\Column(type="boolean")
  29.      */
  30.     private $isUserNeedsToBeActive;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      */
  34.     private $reginfoRule;
  35.     /**
  36.      * @ORM\Column(type="string", length=255, nullable=true)
  37.      */
  38.     private $productVariantRule;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=LeadFormResponse::class)
  41.      * @ORM\JoinColumn(nullable=true)
  42.      */
  43.     private $leadFormResponse;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=FastLead::class, mappedBy="fastLeadTemplate", orphanRemoval=true)
  46.      */
  47.     private $fastLeads;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $fromSource;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $actionNumber;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $regInfo;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $afterSubmitMessage;
  64.     /**
  65.      * @ORM\ManyToOne(targetEntity=ProductVariant::class, inversedBy="fastLeadTemplates")
  66.      */
  67.     private $productVariant;
  68.     /**
  69.      * @ORM\Column(type="integer", nullable=true)
  70.      */
  71.     private $daysForFreeAccess;
  72.     /**
  73.      * @ORM\Column(type="text", nullable=true)
  74.      */
  75.     private $title;
  76.     /**
  77.      * @ORM\Column(type="text", nullable=true)
  78.      */
  79.     private $subtitle;
  80.     /**
  81.      * @ORM\Column(type="text", nullable=true)
  82.      */
  83.     private $footerText;
  84.     /**
  85.      * @ORM\ManyToMany(targetEntity=SalesManagoTagGroup::class, mappedBy="fastLeadTemplate")
  86.      */
  87.     private $salesManagoTagGroups;
  88.     /**
  89.      * @ORM\ManyToMany(targetEntity=ContactSegmentation::class)
  90.      */
  91.     private $contactSegmentations;
  92.     public function __construct()
  93.     {
  94.         $this->fastLeads = new ArrayCollection();
  95.         $this->salesManagoTagGroups = new ArrayCollection();
  96.         $this->contactSegmentations = new ArrayCollection();
  97.     }
  98.     public function getId(): ?int
  99.     {
  100.         return $this->id;
  101.     }
  102.     public function getName(): ?string
  103.     {
  104.         return $this->name;
  105.     }
  106.     public function setName(string $name): self
  107.     {
  108.         $this->name $name;
  109.         return $this;
  110.     }
  111.     public function getSearchType(): ?int
  112.     {
  113.         return $this->searchType;
  114.     }
  115.     public function setSearchType(int $searchType): self
  116.     {
  117.         $this->searchType $searchType;
  118.         return $this;
  119.     }
  120.     public function getIsUserNeedsToBeActive(): ?bool
  121.     {
  122.         return $this->isUserNeedsToBeActive;
  123.     }
  124.     public function setIsUserNeedsToBeActive(bool $isUserNeedsToBeActive): self
  125.     {
  126.         $this->isUserNeedsToBeActive $isUserNeedsToBeActive;
  127.         return $this;
  128.     }
  129.     public function getReginfoRule(): ?string
  130.     {
  131.         return $this->reginfoRule;
  132.     }
  133.     public function setReginfoRule(?string $reginfoRule): self
  134.     {
  135.         $this->reginfoRule $reginfoRule;
  136.         return $this;
  137.     }
  138.     public function getProductVariantRule(): ?string
  139.     {
  140.         return $this->productVariantRule;
  141.     }
  142.     public function setProductVariantRule(?string $productVariantRule): self
  143.     {
  144.         $this->productVariantRule $productVariantRule;
  145.         return $this;
  146.     }
  147.     public function getLeadFormResponse(): ?LeadFormResponse
  148.     {
  149.         return $this->leadFormResponse;
  150.     }
  151.     public function setLeadFormResponse(?LeadFormResponse $leadFormResponse): self
  152.     {
  153.         $this->leadFormResponse $leadFormResponse;
  154.         return $this;
  155.     }
  156.     /**
  157.      * @return Collection|FastLead[]
  158.      */
  159.     public function getFastLeads(): Collection
  160.     {
  161.         return $this->fastLeads;
  162.     }
  163.     public function addFastLead(FastLead $fastLead): self
  164.     {
  165.         if (!$this->fastLeads->contains($fastLead)) {
  166.             $this->fastLeads[] = $fastLead;
  167.             $fastLead->setFastLeadTemplate($this);
  168.         }
  169.         return $this;
  170.     }
  171.     public function removeFastLead(FastLead $fastLead): self
  172.     {
  173.         if ($this->fastLeads->contains($fastLead)) {
  174.             $this->fastLeads->removeElement($fastLead);
  175.             // set the owning side to null (unless already changed)
  176.             if ($fastLead->getFastLeadTemplate() === $this) {
  177.                 $fastLead->setFastLeadTemplate(null);
  178.             }
  179.         }
  180.         return $this;
  181.     }
  182.     public function getFromSource(): ?string
  183.     {
  184.         return $this->fromSource;
  185.     }
  186.     public function setFromSource(?string $fromSource): self
  187.     {
  188.         $this->fromSource $fromSource;
  189.         return $this;
  190.     }
  191.     public function getActionNumber(): ?string
  192.     {
  193.         return $this->actionNumber;
  194.     }
  195.     public function setActionNumber(?string $actionNumber): self
  196.     {
  197.         $this->actionNumber $actionNumber;
  198.         return $this;
  199.     }
  200.     public function getRegInfo(): ?string
  201.     {
  202.         return $this->regInfo;
  203.     }
  204.     public function setRegInfo(?string $regInfo): self
  205.     {
  206.         $this->regInfo $regInfo;
  207.         return $this;
  208.     }
  209.     public function getAfterSubmitMessage(): ?string
  210.     {
  211.         return $this->afterSubmitMessage;
  212.     }
  213.     public function setAfterSubmitMessage(?string $afterSubmitMessage): self
  214.     {
  215.         $this->afterSubmitMessage $afterSubmitMessage;
  216.         return $this;
  217.     }
  218.     public function getProductVariant(): ?ProductVariant
  219.     {
  220.         return $this->productVariant;
  221.     }
  222.     public function setProductVariant(?ProductVariant $productVariant): self
  223.     {
  224.         $this->productVariant $productVariant;
  225.         return $this;
  226.     }
  227.     public function getDaysForFreeAccess(): ?int
  228.     {
  229.         return $this->daysForFreeAccess;
  230.     }
  231.     public function setDaysForFreeAccess(?int $daysForFreeAccess): self
  232.     {
  233.         $this->daysForFreeAccess $daysForFreeAccess;
  234.         return $this;
  235.     }
  236.     public function getTitle(): ?string
  237.     {
  238.         return $this->title;
  239.     }
  240.     public function setTitle(?string $title): self
  241.     {
  242.         $this->title $title;
  243.         return $this;
  244.     }
  245.     public function getSubtitle(): ?string
  246.     {
  247.         return $this->subtitle;
  248.     }
  249.     public function setSubtitle(?string $subtitle): self
  250.     {
  251.         $this->subtitle $subtitle;
  252.         return $this;
  253.     }
  254.     public function getFooterText(): ?string
  255.     {
  256.         return $this->footerText;
  257.     }
  258.     public function setFooterText(?string $footerText): self
  259.     {
  260.         $this->footerText $footerText;
  261.         return $this;
  262.     }
  263.     /**
  264.      * @return Collection|SalesManagoTagGroup[]
  265.      */
  266.     public function getSalesManagoTagGroups(): Collection
  267.     {
  268.         return $this->salesManagoTagGroups;
  269.     }
  270.     public function addSalesManagoTagGroup(SalesManagoTagGroup $salesManagoTagGroup): self
  271.     {
  272.         if (!$this->salesManagoTagGroups->contains($salesManagoTagGroup)) {
  273.             $this->salesManagoTagGroups[] = $salesManagoTagGroup;
  274.             $salesManagoTagGroup->addFastLeadTemplate($this);
  275.         }
  276.         return $this;
  277.     }
  278.     public function removeSalesManagoTagGroup(SalesManagoTagGroup $salesManagoTagGroup): self
  279.     {
  280.         if ($this->salesManagoTagGroups->contains($salesManagoTagGroup)) {
  281.             $this->salesManagoTagGroups->removeElement($salesManagoTagGroup);
  282.             $salesManagoTagGroup->removeFastLeadTemplate($this);
  283.         }
  284.         return $this;
  285.     }
  286.     /**
  287.      * @return Collection|ContactSegmentation[]
  288.      */
  289.     public function getContactSegmentations(): Collection
  290.     {
  291.         return $this->contactSegmentations;
  292.     }
  293.     public function addContactSegmentation(ContactSegmentation $contactSegmentation): self
  294.     {
  295.         if (!$this->contactSegmentations->contains($contactSegmentation)) {
  296.             $this->contactSegmentations[] = $contactSegmentation;
  297.         }
  298.         return $this;
  299.     }
  300.     public function removeContactSegmentation(ContactSegmentation $contactSegmentation): self
  301.     {
  302.         if ($this->contactSegmentations->contains($contactSegmentation)) {
  303.             $this->contactSegmentations->removeElement($contactSegmentation);
  304.         }
  305.         return $this;
  306.     }
  307.     public function getSalesmanagoTags(): array
  308.     {
  309.         return array_values(
  310.             $this->contactSegmentations
  311.                 ->map(function (ContactSegmentation $seg) {
  312.                     return $seg->getSalesmanagoTag();
  313.                 })
  314.                 ->filter(function (?string $tag) {
  315.                     return $tag !== null && $tag !== '';
  316.                 })
  317.                 ->toArray()
  318.         );
  319.     }
  320.     public function getSalesManagoSourceTag(): ?string
  321.     {
  322.         return 'BASIC_FORM';
  323.     }
  324. }