src/Entity/Gos/SalesManagoTagGroup.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Repository\SalesManagoTagGroupRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SalesManagoTagGroupRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class SalesManagoTagGroup
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=64)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\OneToMany(targetEntity=SalesManagoTag::class, mappedBy="tagGroup", orphanRemoval=true, cascade={"persist"})
  25.      */
  26.     private $tags;
  27.     /**
  28.      * @ORM\ManyToMany(targetEntity=NewsletterTemplate::class, inversedBy="salesManagoTagGroups")
  29.      */
  30.     private $newsletterTemplate;
  31.     /**
  32.      * @ORM\ManyToMany(targetEntity=LeadFormResponse::class, inversedBy="salesManagoTagGroups")
  33.      */
  34.     private $leadFormResponse;
  35.     /**
  36.      * @ORM\ManyToMany(targetEntity=FastLeadTemplate::class, inversedBy="salesManagoTagGroups")
  37.      */
  38.     private $fastLeadTemplate;
  39.     /**
  40.      * @ORM\Column(type="datetime")
  41.      */
  42.     private $createdAt;
  43.     /**
  44.      * @ORM\Column(type="datetime", nullable=true)
  45.      */
  46.     private $updatedAt;
  47.     public function __construct()
  48.     {
  49.         $this->tags                 = new ArrayCollection();
  50.         $this->newsletterTemplate   = new ArrayCollection();
  51.         $this->leadFormResponse     = new ArrayCollection();
  52.         $this->fastLeadTemplate     = new ArrayCollection();
  53.     }
  54.     /** @ORM\PrePersist() */
  55.     public function onPrePersist(): void
  56.     {
  57.         $this->createdAt = new \DateTime();
  58.     }
  59.     /** @ORM\PreUpdate() */
  60.     public function onPreUpdate(): void
  61.     {
  62.         $this->updatedAt = new \DateTime();
  63.     }
  64.     public function __toString(): string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getName(): ?string
  73.     {
  74.         return $this->name;
  75.     }
  76.     public function setName(string $name): self
  77.     {
  78.         $this->name $name;
  79.         return $this;
  80.     }
  81.     /**
  82.      * @return Collection|SalesManagoTag[]
  83.      */
  84.     public function getTags(): Collection
  85.     {
  86.         return $this->tags;
  87.     }
  88.     public function addTag(SalesManagoTag $tag): self
  89.     {
  90.         if (!$this->tags->contains($tag)) {
  91.             $this->tags[] = $tag;
  92.             $tag->setTagGroup($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeTag(SalesManagoTag $tag): self
  97.     {
  98.         if ($this->tags->contains($tag)) {
  99.             $this->tags->removeElement($tag);
  100.             // set the owning side to null (unless already changed)
  101.             if ($tag->getTagGroup() === $this) {
  102.                 $tag->setTagGroup(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection|NewsletterTemplate[]
  109.      */
  110.     public function getNewsletterTemplate(): Collection
  111.     {
  112.         return $this->newsletterTemplate;
  113.     }
  114.     public function addNewsletterTemplate(NewsletterTemplate $newsletterTemplate): self
  115.     {
  116.         if (!$this->newsletterTemplate->contains($newsletterTemplate)) {
  117.             $this->newsletterTemplate[] = $newsletterTemplate;
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeNewsletterTemplate(NewsletterTemplate $newsletterTemplate): self
  122.     {
  123.         if ($this->newsletterTemplate->contains($newsletterTemplate)) {
  124.             $this->newsletterTemplate->removeElement($newsletterTemplate);
  125.         }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection|LeadFormResponse[]
  130.      */
  131.     public function getLeadFormResponse(): Collection
  132.     {
  133.         return $this->leadFormResponse;
  134.     }
  135.     public function addLeadFormResponse(LeadFormResponse $leadFormResponse): self
  136.     {
  137.         if (!$this->leadFormResponse->contains($leadFormResponse)) {
  138.             $this->leadFormResponse[] = $leadFormResponse;
  139.         }
  140.         return $this;
  141.     }
  142.     public function removeLeadFormResponse(LeadFormResponse $leadFormResponse): self
  143.     {
  144.         if ($this->leadFormResponse->contains($leadFormResponse)) {
  145.             $this->leadFormResponse->removeElement($leadFormResponse);
  146.         }
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection|FastLeadTemplate[]
  151.      */
  152.     public function getFastLeadTemplate(): Collection
  153.     {
  154.         return $this->fastLeadTemplate;
  155.     }
  156.     public function addFastLeadTemplate(FastLeadTemplate $fastLeadTemplate): self
  157.     {
  158.         if (!$this->fastLeadTemplate->contains($fastLeadTemplate)) {
  159.             $this->fastLeadTemplate[] = $fastLeadTemplate;
  160.         }
  161.         return $this;
  162.     }
  163.     public function removeFastLeadTemplate(FastLeadTemplate $fastLeadTemplate): self
  164.     {
  165.         if ($this->fastLeadTemplate->contains($fastLeadTemplate)) {
  166.             $this->fastLeadTemplate->removeElement($fastLeadTemplate);
  167.         }
  168.         return $this;
  169.     }
  170.     public function getCreatedAt()
  171.     {
  172.         return $this->createdAt;
  173.     }
  174.     public function setCreatedAt($createdAt): self
  175.     {
  176.         $this->createdAt $createdAt;
  177.         return $this;
  178.     }
  179.     public function getUpdatedAt()
  180.     {
  181.         return $this->updatedAt;
  182.     }
  183.     public function setUpdatedAt($updatedAt): self
  184.     {
  185.         $this->updatedAt $updatedAt;
  186.         return $this;
  187.     }
  188. }