src/Entity/Produit/Produit.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Produit;
  3. use App\Entity\Site\Ambiance;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use App\Entity\Volumiq\Configurateur;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\ProduitRepository")
  11.  * @UniqueEntity(
  12.  *      fields= {"modelCommercial", "seoUrl"}
  13.  * )
  14.  * @UniqueEntity("seoUrl")
  15.  */
  16. class Produit
  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 $modelCommercial;
  28.     /**
  29.      * @ORM\Column(type="integer")
  30.      */
  31.     private $placement;
  32.     /**
  33.      * @ORM\Column(type="boolean")
  34.      */
  35.     private $actif;
  36.     /**
  37.      * @ORM\Column(type="text", nullable=true)
  38.      */
  39.     private $avantage;
  40.     /**
  41.      * @ORM\Column(type="text", nullable=true)
  42.      */
  43.     private $description;
  44.     /**
  45.      * @ORM\Column(type="text", nullable=true)
  46.      */
  47.     private $caracteristique;
  48.     /**
  49.      * @ORM\Column(type="date")
  50.      */
  51.     private $date;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $largeurFixe;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $largeurMin;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $largeurMax;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true)
  66.      */
  67.     private $hauteurFixe;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      */
  71.     private $hauteurMin;
  72.     /**
  73.      * @ORM\Column(type="string", length=255, nullable=true)
  74.      */
  75.     private $hauteurMax;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $profondeurFixe;
  80.     /**
  81.      * @ORM\Column(type="string", length=255, nullable=true)
  82.      */
  83.     private $profondeurMin;
  84.     /**
  85.      * @ORM\Column(type="string", length=255, nullable=true)
  86.      */
  87.     private $profondeurMax;
  88.     /**
  89.      * @ORM\ManyToOne(targetEntity="App\Entity\Produit\PartitionProduit", inversedBy="produits", cascade={"persist"})
  90.      * @ORM\JoinColumn(nullable=true)
  91.      */
  92.     private $partitionProduit;
  93.     /**
  94.      * @ORM\ManyToOne(targetEntity="App\Entity\Produit\SousFamille", inversedBy="produits", cascade={"persist"})
  95.      */
  96.     private $sousFamille;
  97.     /**
  98.      * @ORM\OneToMany(targetEntity="App\Entity\Produit\Pdf", mappedBy="produit", orphanRemoval=true, cascade={"persist"})
  99.      */
  100.     private $pdfs;
  101.     /**
  102.      * @ORM\OneToMany(targetEntity="App\Entity\Produit\Image", mappedBy="produit", orphanRemoval=true, cascade={"persist"})
  103.      */
  104.     private $images;
  105.     /**
  106.      * @ORM\ManyToMany(targetEntity="App\Entity\Site\Ambiance", mappedBy="produits")
  107.      */
  108.     private $ambiances;
  109.     /**
  110.      * @ORM\Column(type="string", length=255)
  111.      */
  112.     private $seoUrl;
  113.     /**
  114.      * @ORM\Column(type="string", length=255, nullable=true)
  115.      */
  116.     private $metaTitle;
  117.     /**
  118.      * @ORM\Column(type="text", nullable=true)
  119.      */
  120.     private $metaDescription;
  121.     /**
  122.      * @ORM\ManyToMany(targetEntity="App\Entity\Produit\FiltrePersonalise", inversedBy="produits")
  123.      */
  124.     private $premierFiltres;
  125.     /**
  126.      * @ORM\ManyToMany(targetEntity="App\Entity\Produit\FiltrePersonaliseBis", inversedBy="produits")
  127.      */
  128.     private $secondFiltres;
  129.     /**
  130.      * @ORM\ManyToMany(targetEntity="App\Entity\Produit\Notice", inversedBy="produits")
  131.      */
  132.     private $notices;
  133.     /**
  134.      * @ORM\ManyToMany(targetEntity="App\Entity\Produit\Video", inversedBy="produits")
  135.      */
  136.     private $videos;
  137.     /**
  138.      * @ORM\ManyToOne(targetEntity="App\Entity\Volumiq\Configurateur", inversedBy="produits")
  139.      * @ORM\JoinColumn(nullable=true)
  140.      */
  141.     private $configurateur;
  142.     /**
  143.      * Clé d'url d'une préconfiguration (inspiration) du configurateur façade, stockée
  144.      * côté widget (configurateurs-widget). Sert à associer ce produit coulissant /
  145.      * coulissant atelier à une préconfiguration pré-remplie. Voir l'onglet
  146.      * « Préconfiguration » de ProduitCrudController.
  147.      *
  148.      * @ORM\Column(type="string", length=255, nullable=true)
  149.      */
  150.     private $preconfigUrlKey;
  151.     /**
  152.      * @ORM\ManyToMany(targetEntity="App\Entity\Produit\ProfilGeometrie", mappedBy="produits", cascade={"persist"})
  153.      * @ORM\OrderBy({"placement" = "asc"})
  154.      */
  155.     private $profilGeometries;
  156.     /**
  157.      * @ORM\ManyToMany(targetEntity="App\Entity\Produit\RemplissageNuancier", mappedBy="produits", cascade={"persist"})
  158.      * @ORM\OrderBy({"placement" = "asc"})
  159.      */
  160.     private $remplissageNuanciers;
  161.     /**
  162.      * @ORM\ManyToMany(targetEntity=SousFamille::class, inversedBy="produits", cascade={"persist"})
  163.      */
  164.     private $subFamille;
  165.     public function __construct()
  166.     {
  167.         $this->pdfs = new ArrayCollection();
  168.         $this->videos = new ArrayCollection();
  169.         $this->images = new ArrayCollection();
  170.         $this->date = new \DateTime('now');
  171.         $this->ambiances = new ArrayCollection();
  172.         $this->premierFiltres = new ArrayCollection();
  173.         $this->secondFiltres = new ArrayCollection();
  174.         $this->notices = new ArrayCollection();
  175.         $this->profilGeometries = new ArrayCollection();
  176.         $this->remplissageNuanciers = new ArrayCollection();
  177.         $this->subFamille = new ArrayCollection();
  178.     }
  179.     public function __toString()
  180.     {
  181.         return $this->getModelCommercial();
  182.     }
  183.     public function getId(): ?int
  184.     {
  185.         return $this->id;
  186.     }
  187.     public function getModelCommercial(): ?string
  188.     {
  189.         return $this->modelCommercial;
  190.     }
  191.     public function setModelCommercial(string $modelCommercial): self
  192.     {
  193.         $this->modelCommercial $modelCommercial;
  194.         return $this;
  195.     }
  196.     public function getPlacement(): ?int
  197.     {
  198.         return $this->placement;
  199.     }
  200.     public function setPlacement(int $placement): self
  201.     {
  202.         $this->placement $placement;
  203.         return $this;
  204.     }
  205.     public function getActif(): ?bool
  206.     {
  207.         return $this->actif;
  208.     }
  209.     public function setActif(bool $actif): self
  210.     {
  211.         $this->actif $actif;
  212.         return $this;
  213.     }
  214.     public function getAvantage(): ?string
  215.     {
  216.         return $this->avantage;
  217.     }
  218.     public function setAvantage(?string $avantage): self
  219.     {
  220.         $this->avantage $avantage;
  221.         return $this;
  222.     }
  223.     public function getDescription(): ?string
  224.     {
  225.         return $this->description;
  226.     }
  227.     public function setDescription(?string $description): self
  228.     {
  229.         $this->description $description;
  230.         return $this;
  231.     }
  232.     public function getCaracteristique(): ?string
  233.     {
  234.         return $this->caracteristique;
  235.     }
  236.     public function setCaracteristique(?string $caracteristique): self
  237.     {
  238.         $this->caracteristique $caracteristique;
  239.         return $this;
  240.     }
  241.     public function getDate(): ?\DateTimeInterface
  242.     {
  243.         return $this->date;
  244.     }
  245.     public function setDate(\DateTimeInterface $date): self
  246.     {
  247.         $this->date $date;
  248.         return $this;
  249.     }
  250.     public function getLargeurFixe(): ?string
  251.     {
  252.         return $this->largeurFixe;
  253.     }
  254.     public function setLargeurFixe(?string $largeurFixe): self
  255.     {
  256.         $this->largeurFixe $largeurFixe;
  257.         return $this;
  258.     }
  259.     public function getLargeurMin(): ?string
  260.     {
  261.         return $this->largeurMin;
  262.     }
  263.     public function setLargeurMin(?string $largeurMin): self
  264.     {
  265.         $this->largeurMin $largeurMin;
  266.         return $this;
  267.     }
  268.     public function getLargeurMax(): ?string
  269.     {
  270.         return $this->largeurMax;
  271.     }
  272.     public function setLargeurMax(?string $largeurMax): self
  273.     {
  274.         $this->largeurMax $largeurMax;
  275.         return $this;
  276.     }
  277.     public function getHauteurFixe(): ?string
  278.     {
  279.         return $this->hauteurFixe;
  280.     }
  281.     public function setHauteurFixe(?string $hauteurFixe): self
  282.     {
  283.         $this->hauteurFixe $hauteurFixe;
  284.         return $this;
  285.     }
  286.     public function getHauteurMin(): ?string
  287.     {
  288.         return $this->hauteurMin;
  289.     }
  290.     public function setHauteurMin(?string $hauteurMin): self
  291.     {
  292.         $this->hauteurMin $hauteurMin;
  293.         return $this;
  294.     }
  295.     public function getHauteurMax(): ?string
  296.     {
  297.         return $this->hauteurMax;
  298.     }
  299.     public function setHauteurMax(?string $hauteurMax): self
  300.     {
  301.         $this->hauteurMax $hauteurMax;
  302.         return $this;
  303.     }
  304.     public function getProfondeurFixe(): ?string
  305.     {
  306.         return $this->profondeurFixe;
  307.     }
  308.     public function setProfondeurFixe(?string $profondeurFixe): self
  309.     {
  310.         $this->profondeurFixe $profondeurFixe;
  311.         return $this;
  312.     }
  313.     public function getProfondeurMin(): ?string
  314.     {
  315.         return $this->profondeurMin;
  316.     }
  317.     public function setProfondeurMin(?string $profondeurMin): self
  318.     {
  319.         $this->profondeurMin $profondeurMin;
  320.         return $this;
  321.     }
  322.     public function getProfondeurMax(): ?string
  323.     {
  324.         return $this->profondeurMax;
  325.     }
  326.     public function setProfondeurMax(?string $profondeurMax): self
  327.     {
  328.         $this->profondeurMax $profondeurMax;
  329.         return $this;
  330.     }
  331.     public function getPartitionProduit(): ?PartitionProduit
  332.     {
  333.         return $this->partitionProduit;
  334.     }
  335.     public function setPartitionProduit(?PartitionProduit $partitionProduit): self
  336.     {
  337.         $this->partitionProduit $partitionProduit;
  338.         return $this;
  339.     }
  340.     public function getFamilleProduit(): ?FamilleProduit
  341.     {
  342.         return $this->familleProduit;
  343.     }
  344.     public function setFamilleProduit(?FamilleProduit $familleProduit): self
  345.     {
  346.         $this->familleProduit $familleProduit;
  347.         return $this;
  348.     }
  349.     public function getSousFamille(): ?sousFamille
  350.     {
  351.         return $this->sousFamille;
  352.     }
  353.     public function setSousFamille(?sousFamille $sousFamille): self
  354.     {
  355.         $this->sousFamille $sousFamille;
  356.         return $this;
  357.     }
  358.     /**
  359.      * @return Collection|Pdf[]
  360.      */
  361.     public function getPdfs(): Collection
  362.     {
  363.         return $this->pdfs;
  364.     }
  365.     public function addPdf(Pdf $pdf): self
  366.     {
  367.         if (!$this->pdfs->contains($pdf)) {
  368.             $this->pdfs[] = $pdf;
  369.             $pdf->setProduit($this);
  370.         }
  371.         return $this;
  372.     }
  373.     public function removePdf(Pdf $pdf): self
  374.     {
  375.         if ($this->pdfs->contains($pdf)) {
  376.             $this->pdfs->removeElement($pdf);
  377.             // set the owning side to null (unless already changed)
  378.             if ($pdf->getProduit() === $this) {
  379.                 $pdf->setProduit(null);
  380.             }
  381.         }
  382.         return $this;
  383.     }
  384.     /**
  385.      * @return Collection|Image[]
  386.      */
  387.     public function getImages(): Collection
  388.     {
  389.         return $this->images;
  390.     }
  391.     public function addImage(Image $image): self
  392.     {
  393.         if (!$this->images->contains($image)) {
  394.             $this->images[] = $image;
  395.             $image->setProduit($this);
  396.         }
  397.         return $this;
  398.     }
  399.     public function removeImage(Image $image): self
  400.     {
  401.         if ($this->images->contains($image)) {
  402.             $this->images->removeElement($image);
  403.             // set the owning side to null (unless already changed)
  404.             if ($image->getProduit() === $this) {
  405.                 $image->setProduit(null);
  406.             }
  407.         }
  408.         return $this;
  409.     }
  410.     /**
  411.      * @return Collection|Ambiance[]
  412.      */
  413.     public function getAmbiances(): Collection
  414.     {
  415.         return $this->ambiances;
  416.     }
  417.     public function addAmbiance(Ambiance $ambiance): self
  418.     {
  419.         if (!$this->ambiances->contains($ambiance)) {
  420.             $this->ambiances[] = $ambiance;
  421.             $ambiance->addProduit($this);
  422.         }
  423.         return $this;
  424.     }
  425.     public function removeAmbiance(Ambiance $ambiance): self
  426.     {
  427.         if ($this->ambiances->contains($ambiance)) {
  428.             $this->ambiances->removeElement($ambiance);
  429.             $ambiance->removeProduit($this);
  430.         }
  431.         return $this;
  432.     }
  433.     public function getSeoUrl(): ?string
  434.     {
  435.         return $this->seoUrl;
  436.     }
  437.     public function setSeoUrl(string $seoUrl): self
  438.     {
  439.         $this->seoUrl $seoUrl;
  440.         return $this;
  441.     }
  442.     public function getMetaTitle(): ?string
  443.     {
  444.         return $this->metaTitle;
  445.     }
  446.     public function setMetaTitle(?string $metaTitle): self
  447.     {
  448.         $this->metaTitle $metaTitle;
  449.         return $this;
  450.     }
  451.     public function getMetaDescription(): ?string
  452.     {
  453.         return $this->metaDescription;
  454.     }
  455.     public function setMetaDescription(?string $metaDescription): self
  456.     {
  457.         $this->metaDescription $metaDescription;
  458.         return $this;
  459.     }
  460.     /**
  461.      * @return Collection|FiltrePersonalise[]
  462.      */
  463.     public function getPremierFiltres(): Collection
  464.     {
  465.         return $this->premierFiltres;
  466.     }
  467.     public function addPremierFiltre(FiltrePersonalise $premierFiltre): self
  468.     {
  469.         if (!$this->premierFiltres->contains($premierFiltre)) {
  470.             $this->premierFiltres[] = $premierFiltre;
  471.         }
  472.         return $this;
  473.     }
  474.     public function removePremierFiltre(FiltrePersonalise $premierFiltre): self
  475.     {
  476.         if ($this->premierFiltres->contains($premierFiltre)) {
  477.             $this->premierFiltres->removeElement($premierFiltre);
  478.         }
  479.         return $this;
  480.     }
  481.     /**
  482.      * @return Collection|FiltrePersonaliseBis[]
  483.      */
  484.     public function getSecondFiltres(): Collection
  485.     {
  486.         return $this->secondFiltres;
  487.     }
  488.     public function addSecondFiltre(FiltrePersonaliseBis $secondFiltre): self
  489.     {
  490.         if (!$this->secondFiltres->contains($secondFiltre)) {
  491.             $this->secondFiltres[] = $secondFiltre;
  492.         }
  493.         return $this;
  494.     }
  495.     public function removeSecondFiltre(FiltrePersonaliseBis $secondFiltre): self
  496.     {
  497.         if ($this->secondFiltres->contains($secondFiltre)) {
  498.             $this->secondFiltres->removeElement($secondFiltre);
  499.         }
  500.         return $this;
  501.     }
  502.     /**
  503.      * @return Collection|Notice[]
  504.      */
  505.     public function getNotices(): Collection
  506.     {
  507.         return $this->notices;
  508.     }
  509.     public function addNotice(Notice $notice): self
  510.     {
  511.         if (!$this->notices->contains($notice)) {
  512.             $this->notices[] = $notice;
  513.         }
  514.         return $this;
  515.     }
  516.     public function removeNotice(Notice $notice): self
  517.     {
  518.         if ($this->notices->contains($notice)) {
  519.             $this->notices->removeElement($notice);
  520.         }
  521.         return $this;
  522.     }
  523.     /**
  524.      * @return Collection|Video[]
  525.      */
  526.     public function getVideos(): Collection
  527.     {
  528.         return $this->videos;
  529.     }
  530.     public function addVideo(Video $video): self
  531.     {
  532.         if (!$this->videos->contains($video)) {
  533.             $this->videos[] = $video;
  534.         }
  535.         return $this;
  536.     }
  537.     public function removeVideo(Video $video): self
  538.     {
  539.         if ($this->videos->contains($video)) {
  540.             $this->videos->removeElement($video);
  541.         }
  542.         return $this;
  543.     }
  544.     public function getConfigurateur(): ?Configurateur
  545.     {
  546.         return $this->configurateur;
  547.     }
  548.     public function setConfigurateur(?Configurateur $configurateur): self
  549.     {
  550.         $this->configurateur $configurateur;
  551.         return $this;
  552.     }
  553.     public function getPreconfigUrlKey(): ?string
  554.     {
  555.         return $this->preconfigUrlKey;
  556.     }
  557.     public function setPreconfigUrlKey(?string $preconfigUrlKey): self
  558.     {
  559.         $this->preconfigUrlKey $preconfigUrlKey;
  560.         return $this;
  561.     }
  562.     /**
  563.      * @return Collection|ProfilGeometrie[]
  564.      */
  565.     public function getProfilGeometries(): Collection
  566.     {
  567.         return $this->profilGeometries;
  568.     }
  569.     public function addProfilGeometry(ProfilGeometrie $profilGeometry): self
  570.     {
  571.         if (!$this->profilGeometries->contains($profilGeometry)) {
  572.             $this->profilGeometries[] = $profilGeometry;
  573.             $profilGeometry->addProduit($this);
  574.         }
  575.         return $this;
  576.     }
  577.     public function removeProfilGeometry(ProfilGeometrie $profilGeometry): self
  578.     {
  579.         if ($this->profilGeometries->contains($profilGeometry)) {
  580.             $this->profilGeometries->removeElement($profilGeometry);
  581.             $profilGeometry->removeProduit($this);
  582.         }
  583.         return $this;
  584.     }
  585.     /**
  586.      * @return Collection|RemplissageNuancier[]
  587.      */
  588.     public function getRemplissageNuanciers(): Collection
  589.     {
  590.         return $this->remplissageNuanciers;
  591.     }
  592.     public function addRemplissageNuancier(RemplissageNuancier $remplissageNuancier): self
  593.     {
  594.         if (!$this->remplissageNuanciers->contains($remplissageNuancier)) {
  595.             $this->remplissageNuanciers[] = $remplissageNuancier;
  596.             $remplissageNuancier->addProduit($this);
  597.         }
  598.         return $this;
  599.     }
  600.     public function removeRemplissageNuancier(RemplissageNuancier $remplissageNuancier): self
  601.     {
  602.         if ($this->remplissageNuanciers->contains($remplissageNuancier)) {
  603.             $this->remplissageNuanciers->removeElement($remplissageNuancier);
  604.             $remplissageNuancier->removeProduit($this);
  605.         }
  606.         return $this;
  607.     }
  608.     /**
  609.      * @return Collection<int, SousFamille>
  610.      */
  611.     public function getSubFamille(): Collection
  612.     {
  613.         return $this->subFamille;
  614.     }
  615.     public function addSubFamille(SousFamille $subFamille): self
  616.     {
  617.         if (!$this->subFamille->contains($subFamille)) {
  618.             $this->subFamille[] = $subFamille;
  619.         }
  620.         return $this;
  621.     }
  622.     public function removeSubFamille(SousFamille $subFamille): self
  623.     {
  624.         $this->subFamille->removeElement($subFamille);
  625.         return $this;
  626.     }
  627. }