src/Entity/Selection.php line 12

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\SelectionRepository")
  8.  */
  9. class Selection
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la sélection"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitScoringProfile", inversedBy="selections")
  23.      * @ORM\JoinColumns({
  24.      *   @ORM\JoinColumn(name="scoring_id", referencedColumnName="id")
  25.      * })
  26.      */
  27.     private $score;
  28.     /**
  29.      * @ORM\Column(type="float", nullable=true)
  30.      */
  31.     private $reduceFromDistance;
  32.     /**
  33.      * @ORM\Column(type="float", nullable=true)
  34.      */
  35.     private $reduceUntilDistance;
  36.     /**
  37.      * @ORM\Column(type="float", nullable=true)
  38.      */
  39.     private $reduce;
  40.     /**
  41.      * @var \Doctrine\Common\Collections\Collection
  42.      * @ORM\OneToMany(targetEntity="App\Entity\SelectionItem", mappedBy="selection", cascade={"persist","remove"}, orphanRemoval=true)
  43.      */
  44.     private $items;
  45.     /**
  46.      * @var \Doctrine\Common\Collections\Collection
  47.      * @ORM\OneToMany(targetEntity="App\Entity\WebList", mappedBy="selection", cascade={"persist"})
  48.      */
  49.     private $webLists;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="selections")
  52.      * @ORM\JoinColumns({
  53.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  54.      * })
  55.      */
  56.     private $owner;
  57.     /**
  58.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="selections")
  59.      * @ORM\JoinColumns({
  60.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  61.      * })
  62.      */
  63.     private $entity;
  64.     /**
  65.      * @ORM\Column(type="datetime", nullable=true)
  66.      */
  67.     private $createdAt;
  68.     /**
  69.      * @ORM\Column(type="datetime", nullable=true)
  70.      */
  71.     private $updatedAt;
  72.     /**
  73.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  74.      */
  75.     private $state;
  76.     /**
  77.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"ID de seleciton dans le SIT"})
  78.      */
  79.     private $sitSelectionId;
  80.     /**
  81.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="selections")
  82.      */
  83.     private $tags;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity="App\Entity\EditionPlanification", mappedBy="selection")
  86.      */
  87.     private $planifications;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity="App\Entity\EditionPlanification", mappedBy="selectionGuideAccueil")
  90.      */
  91.     private $guidesAccueilPlanifications;
  92.     /**
  93.      * @ORM\OneToMany(targetEntity="App\Entity\EditionsPlanner", mappedBy="selectionGuideAccueil")
  94.      */
  95.     private $guidesAccueilPlanners;
  96.     /**
  97.      * @var \Doctrine\Common\Collections\Collection
  98.      * @ORM\OneToMany(targetEntity="App\Entity\WebMapItem", mappedBy="selection")
  99.      */
  100.     private $webMapItems;
  101.     /**
  102.      * @var \Doctrine\Common\Collections\Collection
  103.      * @ORM\OneToMany(targetEntity="App\Entity\Diaporama", mappedBy="selection")
  104.      */
  105.     private $diaporamas;
  106.     /**
  107.      * @var \Doctrine\Common\Collections\Collection
  108.      * @ORM\OneToMany(targetEntity="App\Entity\DeeplTranslationConfig", mappedBy="selection")
  109.      */
  110.     private $deeplTranslationConfigs;
  111.     /**
  112.      * @var \Doctrine\Common\Collections\Collection
  113.      *
  114.      * @ORM\OneToMany(targetEntity="App\Entity\ApidaeTranslationConfig", mappedBy="selection", cascade={"persist", "remove"})
  115.      */
  116.     private $apidaeTranslationConfigs;
  117.     /**
  118.      * @var \Doctrine\Common\Collections\Collection
  119.      * @ORM\OneToMany(targetEntity="App\Entity\WebFilterResult", mappedBy="selection")
  120.      */
  121.     private $webFilterResults;
  122.     public function __construct()
  123.     {
  124.         $this->items = new ArrayCollection();
  125.         $this->webLists = new ArrayCollection();
  126.         $this->tags = new ArrayCollection();
  127.         $this->planifications = new ArrayCollection();
  128.         $this->guidesAccueilPlanifications = new ArrayCollection();
  129.         $this->guidesAccueilPlanners = new ArrayCollection();
  130.         $this->webMapItems = new ArrayCollection();
  131.         $this->diaporamas = new ArrayCollection();
  132.         $this->deeplTranslationConfigs = new ArrayCollection();
  133.         $this->apidaeTranslationConfigs = new ArrayCollection();
  134.         $this->webFilterResults = new ArrayCollection();
  135.     }
  136.     public function getId(): ?int
  137.     {
  138.         return $this->id;
  139.     }
  140.     public function getName(): ?string
  141.     {
  142.         return $this->name;
  143.     }
  144.     public function setName(?string $name): self
  145.     {
  146.         $this->name $name;
  147.         return $this;
  148.     }
  149.     public function getReduceFromDistance(): ?float
  150.     {
  151.         return $this->reduceFromDistance;
  152.     }
  153.     public function setReduceFromDistance(?float $reduceFromDistance): self
  154.     {
  155.         $this->reduceFromDistance $reduceFromDistance;
  156.         return $this;
  157.     }
  158.     public function getReduceUntilDistance(): ?float
  159.     {
  160.         return $this->reduceUntilDistance;
  161.     }
  162.     public function setReduceUntilDistance(?float $reduceUntilDistance): self
  163.     {
  164.         $this->reduceUntilDistance $reduceUntilDistance;
  165.         return $this;
  166.     }
  167.     public function getReduce(): ?float
  168.     {
  169.         return $this->reduce;
  170.     }
  171.     public function setReduce(?float $reduce): self
  172.     {
  173.         $this->reduce $reduce;
  174.         return $this;
  175.     }
  176.     public function getCreatedAt(): ?\DateTimeInterface
  177.     {
  178.         return $this->createdAt;
  179.     }
  180.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  181.     {
  182.         $this->createdAt $createdAt;
  183.         return $this;
  184.     }
  185.     public function getUpdatedAt(): ?\DateTimeInterface
  186.     {
  187.         return $this->updatedAt;
  188.     }
  189.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  190.     {
  191.         $this->updatedAt $updatedAt;
  192.         return $this;
  193.     }
  194.     public function getState(): ?int
  195.     {
  196.         return $this->state;
  197.     }
  198.     public function setState(?int $state): self
  199.     {
  200.         $this->state $state;
  201.         return $this;
  202.     }
  203.     public function getSitSelectionId(): ?int
  204.     {
  205.         return $this->sitSelectionId;
  206.     }
  207.     public function setSitSelectionId(?int $sitSelectionId): self
  208.     {
  209.         $this->sitSelectionId $sitSelectionId;
  210.         return $this;
  211.     }
  212.     public function getScore(): ?DnsitScoringProfile
  213.     {
  214.         return $this->score;
  215.     }
  216.     public function setScore(?DnsitScoringProfile $score): self
  217.     {
  218.         $this->score $score;
  219.         return $this;
  220.     }
  221.     /**
  222.      * @return Collection|SelectionItem[]
  223.      */
  224.     public function getItems(): Collection
  225.     {
  226.         return $this->items;
  227.     }
  228.     public function addItem(SelectionItem $item): self
  229.     {
  230.         if (!$this->items->contains($item)) {
  231.             $this->items[] = $item;
  232.             $item->setSelection($this);
  233.         }
  234.         return $this;
  235.     }
  236.     public function removeItem(SelectionItem $item): self
  237.     {
  238.         if ($this->items->contains($item)) {
  239.             $this->items->removeElement($item);
  240.             // set the owning side to null (unless already changed)
  241.             if ($item->getSelection() === $this) {
  242.                 $item->setSelection(null);
  243.             }
  244.         }
  245.         return $this;
  246.     }
  247.     /**
  248.      * @return Collection|WebList[]
  249.      */
  250.     public function getWebLists(): Collection
  251.     {
  252.         return $this->webLists;
  253.     }
  254.     public function addWebList(WebList $webList): self
  255.     {
  256.         if (!$this->webLists->contains($webList)) {
  257.             $this->webLists[] = $webList;
  258.             $webList->setSelection($this);
  259.         }
  260.         return $this;
  261.     }
  262.     public function removeWebList(WebList $webList): self
  263.     {
  264.         if ($this->webLists->contains($webList)) {
  265.             $this->webLists->removeElement($webList);
  266.             // set the owning side to null (unless already changed)
  267.             if ($webList->getSelection() === $this) {
  268.                 $webList->setSelection(null);
  269.             }
  270.         }
  271.         return $this;
  272.     }
  273.     /**
  274.      * @return Collection|Tag[]
  275.      */
  276.     public function getTags(): Collection
  277.     {
  278.         return $this->tags;
  279.     }
  280.     public function addTag(Tag $tag): self
  281.     {
  282.         if (!$this->tags->contains($tag)) {
  283.             $this->tags[] = $tag;
  284.         }
  285.         return $this;
  286.     }
  287.     public function removeTag(Tag $tag): self
  288.     {
  289.         if ($this->tags->contains($tag)) {
  290.             $this->tags->removeElement($tag);
  291.         }
  292.         return $this;
  293.     }
  294.     public function getOwner(): ?User
  295.     {
  296.         return $this->owner;
  297.     }
  298.     public function setOwner(?User $owner): self
  299.     {
  300.         $this->owner $owner;
  301.         return $this;
  302.     }
  303.     public function getEntity(): ?DnsitEntity
  304.     {
  305.         return $this->entity;
  306.     }
  307.     public function setEntity(?DnsitEntity $entity): self
  308.     {
  309.         $this->entity $entity;
  310.         return $this;
  311.     }
  312.     /**
  313.      * @return Collection|EditionPlanification[]
  314.      */
  315.     public function getPlanifications(): Collection
  316.     {
  317.         return $this->planifications;
  318.     }
  319.     public function addPlanification(EditionPlanification $planification): self
  320.     {
  321.         if (!$this->planifications->contains($planification)) {
  322.             $this->planifications[] = $planification;
  323.             $planification->setSelection($this);
  324.         }
  325.         return $this;
  326.     }
  327.     public function removePlanification(EditionPlanification $planification): self
  328.     {
  329.         if ($this->planifications->contains($planification)) {
  330.             $this->planifications->removeElement($planification);
  331.             // set the owning side to null (unless already changed)
  332.             if ($planification->getSelection() === $this) {
  333.                 $planification->setSelection(null);
  334.             }
  335.         }
  336.         return $this;
  337.     }
  338.     /**
  339.      * @return Collection|EditionPlanification[]
  340.      */
  341.     public function getGuidesAccueilPlanifications(): Collection
  342.     {
  343.         return $this->guidesAccueilPlanifications;
  344.     }
  345.     public function addGuidesAccueilPlanifications(EditionPlanification $planification): self
  346.     {
  347.         if (!$this->guidesAccueilPlanifications->contains($planification)) {
  348.             $this->guidesAccueilPlanifications[] = $planification;
  349.             $planification->setSelectionGuideAccueil($this);
  350.         }
  351.         return $this;
  352.     }
  353.     public function removeGuidesAccueilPlanification(EditionPlanification $planification): self
  354.     {
  355.         if ($this->guidesAccueilPlanifications->contains($planification)) {
  356.             $this->guidesAccueilPlanifications->removeElement($planification);
  357.             // set the owning side to null (unless already changed)
  358.             if ($planification->getSelectionGuideAccueil() === $this) {
  359.                 $planification->setSelectionGuideAccueil(null);
  360.             }
  361.         }
  362.         return $this;
  363.     }
  364.     /**
  365.      * @return Collection|EditionsPlanner[]
  366.      */
  367.     public function getGuidesAccueilPlanners(): Collection
  368.     {
  369.         return $this->guidesAccueilPlanners;
  370.     }
  371.     public function addGuidesAccueilPlanner(EditionsPlanner $planner): self
  372.     {
  373.         if (!$this->guidesAccueilPlanners->contains($planner)) {
  374.             $this->guidesAccueilPlanners[] = $planner;
  375.             $planner->setSelectionGuideAccueil($this);
  376.         }
  377.         return $this;
  378.     }
  379.     public function removeGuidesAccueilPlanner(EditionsPlanner $planner): self
  380.     {
  381.         if ($this->guidesAccueilPlanners->contains($planner)) {
  382.             $this->guidesAccueilPlanners->removeElement($planner);
  383.             // set the owning side to null (unless already changed)
  384.             if ($planner->getSelectionGuideAccueil() === $this) {
  385.                 $planner->setSelectionGuideAccueil(null);
  386.             }
  387.         }
  388.         return $this;
  389.     }
  390.     /**
  391.      * @return Collection|WebMapItem[]
  392.      */
  393.     public function getWebMapItems(): Collection
  394.     {
  395.         return $this->webMapItems;
  396.     }
  397.     public function addWebMapItem(WebMapItem $webMapItem): self
  398.     {
  399.         if (!$this->webMapItems->contains($webMapItem)) {
  400.             $this->webMapItems[] = $webMapItem;
  401.             $webMapItem->setSelection($this);
  402.         }
  403.         return $this;
  404.     }
  405.     public function removeWebMapItem(WebMapItem $webMapItem): self
  406.     {
  407.         if ($this->webMapItems->contains($webMapItem)) {
  408.             $this->webMapItems->removeElement($webMapItem);
  409.             // set the owning side to null (unless already changed)
  410.             if ($webMapItem->getSelection() === $this) {
  411.                 $webMapItem->setSelection(null);
  412.             }
  413.         }
  414.         return $this;
  415.     }
  416.     /**
  417.      * @return Collection|Diaporama[]
  418.      */
  419.     public function getDiaporamas(): Collection
  420.     {
  421.         return $this->diaporamas;
  422.     }
  423.     public function addDiaporama(Diaporama $diaporama): self
  424.     {
  425.         if (!$this->diaporamas->contains($diaporama)) {
  426.             $this->diaporamas[] = $diaporama;
  427.             $diaporama->setSelection($this);
  428.         }
  429.         return $this;
  430.     }
  431.     public function removeDiaporama(Diaporama $diaporama): self
  432.     {
  433.         if ($this->diaporamas->contains($diaporama)) {
  434.             $this->diaporamas->removeElement($diaporama);
  435.             // set the owning side to null (unless already changed)
  436.             if ($diaporama->getSelection() === $this) {
  437.                 $diaporama->setSelection(null);
  438.             }
  439.         }
  440.         return $this;
  441.     }
  442.     /**
  443.      * @return Collection|DeeplTranslationConfig[]
  444.      */
  445.     public function getDeeplTranslationConfigs(): Collection
  446.     {
  447.         return $this->deeplTranslationConfigs;
  448.     }
  449.     public function addDeeplTranslationConfig(DeeplTranslationConfig $deeplTranslationConfig): self
  450.     {
  451.         if (!$this->deeplTranslationConfigs->contains($deeplTranslationConfig)) {
  452.             $this->deeplTranslationConfigs[] = $deeplTranslationConfig;
  453.             $deeplTranslationConfig->setSelection($this);
  454.         }
  455.         return $this;
  456.     }
  457.     public function removeDeeplTranslationConfig(DeeplTranslationConfig $deeplTranslationConfig): self
  458.     {
  459.         if ($this->deeplTranslationConfigs->contains($deeplTranslationConfig)) {
  460.             $this->deeplTranslationConfigs->removeElement($deeplTranslationConfig);
  461.             // set the owning side to null (unless already changed)
  462.             if ($deeplTranslationConfig->getSelection() === $this) {
  463.                 $deeplTranslationConfig->setSelection(null);
  464.             }
  465.         }
  466.         return $this;
  467.     }
  468.     /**
  469.      * @return Collection|ApidaeTranslationConfig[]
  470.      */
  471.     public function getApidaeTranslationConfigs(): Collection
  472.     {
  473.         return $this->apidaeTranslationConfigs;
  474.     }
  475.     public function addApidaeTranslationConfig(ApidaeTranslationConfig $apidaeTranslationConfigs): self
  476.     {
  477.         if (!$this->apidaeTranslationConfigs->contains($apidaeTranslationConfigs)) {
  478.             $this->apidaeTranslationConfigs[] = $apidaeTranslationConfigs;
  479.             $apidaeTranslationConfigs->setSelection($this);
  480.         }
  481.         return $this;
  482.     }
  483.     public function removeApidaeTranslationConfig(ApidaeTranslationConfig $apidaeTranslationConfigs): self
  484.     {
  485.         if ($this->apidaeTranslationConfigs->contains($apidaeTranslationConfigs)) {
  486.             $this->apidaeTranslationConfigs->removeElement($apidaeTranslationConfigs);
  487.             // set the owning side to null (unless already changed)
  488.             if ($apidaeTranslationConfigs->getSelection() === $this) {
  489.                 $apidaeTranslationConfigs->setSelection(null);
  490.             }
  491.         }
  492.         return $this;
  493.     }
  494.     /**
  495.      * @return Collection|WebFilterResult[]
  496.      */
  497.     public function getWebFilterResults(): Collection
  498.     {
  499.         return $this->webFilterResults;
  500.     }
  501.     public function addWebFilterResult(WebFilterResult $webFilterResult): self
  502.     {
  503.         if (!$this->webFilterResults->contains($webFilterResult)) {
  504.             $this->webFilterResults[] = $webFilterResult;
  505.             $webFilterResult->setSelection($this);
  506.         }
  507.         return $this;
  508.     }
  509.     public function removeWebFilterResult(WebFilterResult $webFilterResult): self
  510.     {
  511.         if ($this->webFilterResults->contains($webFilterResult)) {
  512.             $this->webFilterResults->removeElement($webFilterResult);
  513.             // set the owning side to null (unless already changed)
  514.             if ($webFilterResult->getSelection() === $this) {
  515.                 $webFilterResult->setSelection(null);
  516.             }
  517.         }
  518.         return $this;
  519.     }
  520. }