src/Entity/Tag.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\TagRepository")
  8.  */
  9. class Tag
  10. {
  11.     public function __construct()
  12.     {
  13.         $this->selections = new ArrayCollection();
  14.         $this->blocks = new ArrayCollection();
  15.         $this->sorts = new ArrayCollection();
  16.         $this->webEngines = new ArrayCollection();
  17.         $this->webPages = new ArrayCollection();
  18.         $this->webLists = new ArrayCollection();
  19.         $this->listModels = new ArrayCollection();
  20.         $this->webFilters = new ArrayCollection();
  21.         $this->scoringProfiles = new ArrayCollection();
  22.         $this->diaporama = new ArrayCollection();
  23.         $this->webMaps = new ArrayCollection();
  24.     }
  25.     /**
  26.      * @ORM\Id()
  27.      * @ORM\GeneratedValue()
  28.      * @ORM\Column(type="integer")
  29.      */
  30.     private $id;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $name;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="tags")
  37.      * @ORM\JoinColumns({
  38.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  39.      * })
  40.      */
  41.     private $owner;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="tags")
  44.      * @ORM\JoinColumns({
  45.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  46.      * })
  47.      */
  48.     private $entity;
  49.     /**
  50.      * @ORM\ManyToMany(targetEntity="App\Entity\Selection", mappedBy="tags")
  51.      */
  52.     private $selections;
  53.     /**
  54.      * @ORM\ManyToMany(targetEntity="App\Entity\Block", mappedBy="tags")
  55.      */
  56.     private $blocks;
  57.     /**
  58.      * @ORM\ManyToMany(targetEntity="App\Entity\WebSort", mappedBy="tags")
  59.      */
  60.     private $sorts;
  61.     /**
  62.      * @ORM\ManyToMany(targetEntity="App\Entity\WebEngine", mappedBy="tags")
  63.      */
  64.     private $webEngines;
  65.     /**
  66.      * @ORM\ManyToMany(targetEntity="App\Entity\WebPage", mappedBy="tags")
  67.      */
  68.     private $webPages;
  69.     /**
  70.      * @ORM\ManyToMany(targetEntity="App\Entity\WebList", mappedBy="tags")
  71.      */
  72.     private $webLists;
  73.     /**
  74.      * @ORM\ManyToMany(targetEntity="App\Entity\ListModel", mappedBy="tags")
  75.      */
  76.     private $listModels;
  77.     /**
  78.      * @ORM\ManyToMany(targetEntity="App\Entity\WebFilter", mappedBy="tags")
  79.      */
  80.     private $webFilters;
  81.     /**
  82.      * @ORM\ManyToMany(targetEntity="App\Entity\DnsitScoringProfile", mappedBy="tags")
  83.      */
  84.     private $scoringProfiles;
  85.     /**
  86.      * @ORM\Column(type="datetime", nullable=true)
  87.      */
  88.     private $createdAt;
  89.     /**
  90.      * @ORM\Column(type="datetime", nullable=true)
  91.      */
  92.     private $updatedAt;
  93.     /**
  94.      * @ORM\ManyToMany(targetEntity="App\Entity\Diaporama", mappedBy="tags")
  95.      */
  96.     private $diaporama;
  97.     /**
  98.      * @ORM\ManyToMany(targetEntity="App\Entity\WebMap", mappedBy="tags")
  99.      */
  100.     private $webMaps;
  101.     public function getId() : ?int
  102.     {
  103.         return $this->id;
  104.     }
  105.     public function getName() : ?string
  106.     {
  107.         return $this->name;
  108.     }
  109.     public function setName(string $name) : self
  110.     {
  111.         $this->name $name;
  112.         return $this;
  113.     }
  114.     public function getOwner() : ?User
  115.     {
  116.         return $this->owner;
  117.     }
  118.     public function setOwner(?User $owner) : self
  119.     {
  120.         $this->owner $owner;
  121.         return $this;
  122.     }
  123.     public function getEntity() : ?DnsitEntity
  124.     {
  125.         return $this->entity;
  126.     }
  127.     public function setEntity(?DnsitEntity $entity) : self
  128.     {
  129.         $this->entity $entity;
  130.         return $this;
  131.     }
  132.     public function getCreatedAt() : ?\DateTimeInterface
  133.     {
  134.         return $this->createdAt;
  135.     }
  136.     public function setCreatedAt(\DateTimeInterface $createdAt) : self
  137.     {
  138.         $this->createdAt $createdAt;
  139.         return $this;
  140.     }
  141.     public function getUpdatedAt() : ?\DateTimeInterface
  142.     {
  143.         return $this->updatedAt;
  144.     }
  145.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  146.     {
  147.         $this->updatedAt $updatedAt;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection|Selection[]
  152.      */
  153.     public function getSelections() : Collection
  154.     {
  155.         return $this->selections;
  156.     }
  157.     public function addSelection(Selection $selection) : self
  158.     {
  159.         if (!$this->selections->contains($selection)) {
  160.             $this->selections[] = $selection;
  161.             $selection->addTag($this);
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeSelection(Selection $selection) : self
  166.     {
  167.         if ($this->selections->contains($selection)) {
  168.             $this->selections->removeElement($selection);
  169.             $selection->removeTag($this);
  170.         }
  171.         return $this;
  172.     }
  173.     /**
  174.      * @return Collection|Block[]
  175.      */
  176.     public function getBlocks() : Collection
  177.     {
  178.         return $this->blocks;
  179.     }
  180.     public function addBlock(Block $block) : self
  181.     {
  182.         if (!$this->blocks->contains($block)) {
  183.             $this->blocks[] = $block;
  184.             $block->addTag($this);
  185.         }
  186.         return $this;
  187.     }
  188.     public function removeBlock(Block $block) : self
  189.     {
  190.         if ($this->blocks->contains($block)) {
  191.             $this->blocks->removeElement($block);
  192.             $block->removeTag($this);
  193.         }
  194.         return $this;
  195.     }
  196.     /**
  197.      * @return Collection|WebSort[]
  198.      */
  199.     public function getSorts() : Collection
  200.     {
  201.         return $this->sorts;
  202.     }
  203.     public function addSort(WebSort $sort) : self
  204.     {
  205.         if (!$this->sorts->contains($sort)) {
  206.             $this->sorts[] = $sort;
  207.             $sort->addTag($this);
  208.         }
  209.         return $this;
  210.     }
  211.     public function removeSort(WebSort $sort) : self
  212.     {
  213.         if ($this->sorts->contains($sort)) {
  214.             $this->sorts->removeElement($sort);
  215.             $sort->removeTag($this);
  216.         }
  217.         return $this;
  218.     }
  219.     /**
  220.      * @return Collection|WebEngine[]
  221.      */
  222.     public function getWebEngines() : Collection
  223.     {
  224.         return $this->webEngines;
  225.     }
  226.     public function addWebEngine(WebEngine $engine) : self
  227.     {
  228.         if (!$this->webEngines->contains($engine)) {
  229.             $this->webEngines[] = $engine;
  230.             $engine->addTag($this);
  231.         }
  232.         return $this;
  233.     }
  234.     public function removeWebEngine(WebEngine $engine) : self
  235.     {
  236.         if ($this->webEngines->contains($engine)) {
  237.             $this->webEngines->removeElement($engine);
  238.             $engine->removeTag($this);
  239.         }
  240.         return $this;
  241.     }
  242.     /**
  243.      * @return Collection|WebPage[]
  244.      */
  245.     public function getWebPages() : Collection
  246.     {
  247.         return $this->webPages;
  248.     }
  249.     public function addWebPage(WebPage $webPage) : self
  250.     {
  251.         if (!$this->webPages->contains($webPage)) {
  252.             $this->webPages[] = $webPage;
  253.             $webPage->addTag($this);
  254.         }
  255.         return $this;
  256.     }
  257.     public function removeWebPage(WebPage $webPage) : self
  258.     {
  259.         if ($this->webPages->contains($webPage)) {
  260.             $this->webPages->removeElement($webPage);
  261.             $webPage->removeTag($this);
  262.         }
  263.         return $this;
  264.     }
  265.     /**
  266.      * @return Collection|WebList[]
  267.      */
  268.     public function getWebLists() : Collection
  269.     {
  270.         return $this->webLists;
  271.     }
  272.     public function addWebList(WebList $webList) : self
  273.     {
  274.         if (!$this->webLists->contains($webList)) {
  275.             $this->webLists[] = $webList;
  276.             $webList->addTag($this);
  277.         }
  278.         return $this;
  279.     }
  280.     public function removeWebList(WebList $webList) : self
  281.     {
  282.         if ($this->webLists->contains($webList)) {
  283.             $this->webLists->removeElement($webList);
  284.             $webList->removeTag($this);
  285.         }
  286.         return $this;
  287.     }
  288.     /**
  289.      * @return Collection|ListModel[]
  290.      */
  291.     public function getListModels() : Collection
  292.     {
  293.         return $this->listModels;
  294.     }
  295.     public function addListModel(ListModel $listModel) : self
  296.     {
  297.         if (!$this->listModels->contains($listModel)) {
  298.             $this->listModels[] = $listModel;
  299.             $listModel->addTag($this);
  300.         }
  301.         return $this;
  302.     }
  303.     public function removeListModel(ListModel $listModel) : self
  304.     {
  305.         if ($this->listModels->contains($listModel)) {
  306.             $this->listModels->removeElement($listModel);
  307.             $listModel->removeTag($this);
  308.         }
  309.         return $this;
  310.     }
  311.     /**
  312.      * @return Collection|WebFilter[]
  313.      */
  314.     public function getWebFilters() : Collection
  315.     {
  316.         return $this->webFilters;
  317.     }
  318.     public function addWebFilter(WebFilter $webFilter) : self
  319.     {
  320.         if (!$this->webFilters->contains($webFilter)) {
  321.             $this->webFilters[] = $webFilter;
  322.             $webFilter->addTag($this);
  323.         }
  324.         return $this;
  325.     }
  326.     public function removeWebFilter(WebFilter $webFilter) : self
  327.     {
  328.         if ($this->webFilters->contains($webFilter)) {
  329.             $this->webFilters->removeElement($webFilter);
  330.             $webFilter->removeTag($this);
  331.         }
  332.         return $this;
  333.     }
  334.     /**
  335.      * @return Collection|DnsitScoringProfile[]
  336.      */
  337.     public function getScoringProfiles() : Collection
  338.     {
  339.         return $this->scoringProfiles;
  340.     }
  341.     public function addScoringProfile(DnsitScoringProfile $scoringProfile) : self
  342.     {
  343.         if (!$this->scoringProfiles->contains($scoringProfile)) {
  344.             $this->scoringProfiles[] = $scoringProfile;
  345.             $scoringProfile->addTag($this);
  346.         }
  347.         return $this;
  348.     }
  349.     public function removeScoringProfile(DnsitScoringProfile $scoringProfile) : self
  350.     {
  351.         if ($this->scoringProfiles->contains($scoringProfile)) {
  352.             $this->scoringProfiles->removeElement($scoringProfile);
  353.             $scoringProfile->removeTag($this);
  354.         }
  355.         return $this;
  356.     }
  357.     /**
  358.      * @return Collection|Diaporama[]
  359.      */
  360.     public function getDiaporama() : Collection
  361.     {
  362.         return $this->diaporama;
  363.     }
  364.     public function addDiaporama(Diaporama $diaporama) : self
  365.     {
  366.         if (!$this->diaporama->contains($diaporama)) {
  367.             $this->diaporama[] = $diaporama;
  368.             $diaporama->addTag($this);
  369.         }
  370.         return $this;
  371.     }
  372.     public function removeDiaporama(Diaporama $diaporama) : self
  373.     {
  374.         if ($this->diaporama->contains($diaporama)) {
  375.             $this->diaporama->removeElement($diaporama);
  376.             $diaporama->removeTag($this);
  377.         }
  378.         return $this;
  379.     }
  380.     /**
  381.      * @return Collection|WebMap[]
  382.      */
  383.     public function getWebMaps() : Collection
  384.     {
  385.         return $this->webMaps;
  386.     }
  387.     public function addWebMap(WebMap $webMap) : self
  388.     {
  389.         if (!$this->webMaps->contains($webMap)) {
  390.             $this->webMaps[] = $webMap;
  391.             $webMap->addTag($this);
  392.         }
  393.         return $this;
  394.     }
  395.     public function removeWebMap(WebMap $webMap) : self
  396.     {
  397.         if ($this->webMaps->contains($webMap)) {
  398.             $this->webMaps->removeElement($webMap);
  399.             $webMap->removeTag($this);
  400.         }
  401.         return $this;
  402.     }
  403. }