<?php
namespace App\Entity\Produit;
use App\Entity\Site\Ambiance;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use App\Entity\Volumiq\Configurateur;
/**
* @ORM\Entity(repositoryClass="App\Repository\ProduitRepository")
* @UniqueEntity(
* fields= {"modelCommercial", "seoUrl"}
* )
* @UniqueEntity("seoUrl")
*/
class Produit
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $modelCommercial;
/**
* @ORM\Column(type="integer")
*/
private $placement;
/**
* @ORM\Column(type="boolean")
*/
private $actif;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $avantage;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $caracteristique;
/**
* @ORM\Column(type="date")
*/
private $date;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $largeurFixe;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $largeurMin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $largeurMax;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hauteurFixe;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hauteurMin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hauteurMax;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profondeurFixe;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profondeurMin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profondeurMax;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Produit\PartitionProduit", inversedBy="produits", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $partitionProduit;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Produit\SousFamille", inversedBy="produits", cascade={"persist"})
*/
private $sousFamille;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Produit\Pdf", mappedBy="produit", orphanRemoval=true, cascade={"persist"})
*/
private $pdfs;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Produit\Image", mappedBy="produit", orphanRemoval=true, cascade={"persist"})
*/
private $images;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Site\Ambiance", mappedBy="produits")
*/
private $ambiances;
/**
* @ORM\Column(type="string", length=255)
*/
private $seoUrl;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $metaTitle;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $metaDescription;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Produit\FiltrePersonalise", inversedBy="produits")
*/
private $premierFiltres;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Produit\FiltrePersonaliseBis", inversedBy="produits")
*/
private $secondFiltres;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Produit\Notice", inversedBy="produits")
*/
private $notices;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Produit\Video", inversedBy="produits")
*/
private $videos;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Volumiq\Configurateur", inversedBy="produits")
* @ORM\JoinColumn(nullable=true)
*/
private $configurateur;
/**
* Clé d'url d'une préconfiguration (inspiration) du configurateur façade, stockée
* côté widget (configurateurs-widget). Sert à associer ce produit coulissant /
* coulissant atelier à une préconfiguration pré-remplie. Voir l'onglet
* « Préconfiguration » de ProduitCrudController.
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $preconfigUrlKey;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Produit\ProfilGeometrie", mappedBy="produits", cascade={"persist"})
* @ORM\OrderBy({"placement" = "asc"})
*/
private $profilGeometries;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Produit\RemplissageNuancier", mappedBy="produits", cascade={"persist"})
* @ORM\OrderBy({"placement" = "asc"})
*/
private $remplissageNuanciers;
/**
* @ORM\ManyToMany(targetEntity=SousFamille::class, inversedBy="produits", cascade={"persist"})
*/
private $subFamille;
public function __construct()
{
$this->pdfs = new ArrayCollection();
$this->videos = new ArrayCollection();
$this->images = new ArrayCollection();
$this->date = new \DateTime('now');
$this->ambiances = new ArrayCollection();
$this->premierFiltres = new ArrayCollection();
$this->secondFiltres = new ArrayCollection();
$this->notices = new ArrayCollection();
$this->profilGeometries = new ArrayCollection();
$this->remplissageNuanciers = new ArrayCollection();
$this->subFamille = new ArrayCollection();
}
public function __toString()
{
return $this->getModelCommercial();
}
public function getId(): ?int
{
return $this->id;
}
public function getModelCommercial(): ?string
{
return $this->modelCommercial;
}
public function setModelCommercial(string $modelCommercial): self
{
$this->modelCommercial = $modelCommercial;
return $this;
}
public function getPlacement(): ?int
{
return $this->placement;
}
public function setPlacement(int $placement): self
{
$this->placement = $placement;
return $this;
}
public function getActif(): ?bool
{
return $this->actif;
}
public function setActif(bool $actif): self
{
$this->actif = $actif;
return $this;
}
public function getAvantage(): ?string
{
return $this->avantage;
}
public function setAvantage(?string $avantage): self
{
$this->avantage = $avantage;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCaracteristique(): ?string
{
return $this->caracteristique;
}
public function setCaracteristique(?string $caracteristique): self
{
$this->caracteristique = $caracteristique;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getLargeurFixe(): ?string
{
return $this->largeurFixe;
}
public function setLargeurFixe(?string $largeurFixe): self
{
$this->largeurFixe = $largeurFixe;
return $this;
}
public function getLargeurMin(): ?string
{
return $this->largeurMin;
}
public function setLargeurMin(?string $largeurMin): self
{
$this->largeurMin = $largeurMin;
return $this;
}
public function getLargeurMax(): ?string
{
return $this->largeurMax;
}
public function setLargeurMax(?string $largeurMax): self
{
$this->largeurMax = $largeurMax;
return $this;
}
public function getHauteurFixe(): ?string
{
return $this->hauteurFixe;
}
public function setHauteurFixe(?string $hauteurFixe): self
{
$this->hauteurFixe = $hauteurFixe;
return $this;
}
public function getHauteurMin(): ?string
{
return $this->hauteurMin;
}
public function setHauteurMin(?string $hauteurMin): self
{
$this->hauteurMin = $hauteurMin;
return $this;
}
public function getHauteurMax(): ?string
{
return $this->hauteurMax;
}
public function setHauteurMax(?string $hauteurMax): self
{
$this->hauteurMax = $hauteurMax;
return $this;
}
public function getProfondeurFixe(): ?string
{
return $this->profondeurFixe;
}
public function setProfondeurFixe(?string $profondeurFixe): self
{
$this->profondeurFixe = $profondeurFixe;
return $this;
}
public function getProfondeurMin(): ?string
{
return $this->profondeurMin;
}
public function setProfondeurMin(?string $profondeurMin): self
{
$this->profondeurMin = $profondeurMin;
return $this;
}
public function getProfondeurMax(): ?string
{
return $this->profondeurMax;
}
public function setProfondeurMax(?string $profondeurMax): self
{
$this->profondeurMax = $profondeurMax;
return $this;
}
public function getPartitionProduit(): ?PartitionProduit
{
return $this->partitionProduit;
}
public function setPartitionProduit(?PartitionProduit $partitionProduit): self
{
$this->partitionProduit = $partitionProduit;
return $this;
}
public function getFamilleProduit(): ?FamilleProduit
{
return $this->familleProduit;
}
public function setFamilleProduit(?FamilleProduit $familleProduit): self
{
$this->familleProduit = $familleProduit;
return $this;
}
public function getSousFamille(): ?sousFamille
{
return $this->sousFamille;
}
public function setSousFamille(?sousFamille $sousFamille): self
{
$this->sousFamille = $sousFamille;
return $this;
}
/**
* @return Collection|Pdf[]
*/
public function getPdfs(): Collection
{
return $this->pdfs;
}
public function addPdf(Pdf $pdf): self
{
if (!$this->pdfs->contains($pdf)) {
$this->pdfs[] = $pdf;
$pdf->setProduit($this);
}
return $this;
}
public function removePdf(Pdf $pdf): self
{
if ($this->pdfs->contains($pdf)) {
$this->pdfs->removeElement($pdf);
// set the owning side to null (unless already changed)
if ($pdf->getProduit() === $this) {
$pdf->setProduit(null);
}
}
return $this;
}
/**
* @return Collection|Image[]
*/
public function getImages(): Collection
{
return $this->images;
}
public function addImage(Image $image): self
{
if (!$this->images->contains($image)) {
$this->images[] = $image;
$image->setProduit($this);
}
return $this;
}
public function removeImage(Image $image): self
{
if ($this->images->contains($image)) {
$this->images->removeElement($image);
// set the owning side to null (unless already changed)
if ($image->getProduit() === $this) {
$image->setProduit(null);
}
}
return $this;
}
/**
* @return Collection|Ambiance[]
*/
public function getAmbiances(): Collection
{
return $this->ambiances;
}
public function addAmbiance(Ambiance $ambiance): self
{
if (!$this->ambiances->contains($ambiance)) {
$this->ambiances[] = $ambiance;
$ambiance->addProduit($this);
}
return $this;
}
public function removeAmbiance(Ambiance $ambiance): self
{
if ($this->ambiances->contains($ambiance)) {
$this->ambiances->removeElement($ambiance);
$ambiance->removeProduit($this);
}
return $this;
}
public function getSeoUrl(): ?string
{
return $this->seoUrl;
}
public function setSeoUrl(string $seoUrl): self
{
$this->seoUrl = $seoUrl;
return $this;
}
public function getMetaTitle(): ?string
{
return $this->metaTitle;
}
public function setMetaTitle(?string $metaTitle): self
{
$this->metaTitle = $metaTitle;
return $this;
}
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
public function setMetaDescription(?string $metaDescription): self
{
$this->metaDescription = $metaDescription;
return $this;
}
/**
* @return Collection|FiltrePersonalise[]
*/
public function getPremierFiltres(): Collection
{
return $this->premierFiltres;
}
public function addPremierFiltre(FiltrePersonalise $premierFiltre): self
{
if (!$this->premierFiltres->contains($premierFiltre)) {
$this->premierFiltres[] = $premierFiltre;
}
return $this;
}
public function removePremierFiltre(FiltrePersonalise $premierFiltre): self
{
if ($this->premierFiltres->contains($premierFiltre)) {
$this->premierFiltres->removeElement($premierFiltre);
}
return $this;
}
/**
* @return Collection|FiltrePersonaliseBis[]
*/
public function getSecondFiltres(): Collection
{
return $this->secondFiltres;
}
public function addSecondFiltre(FiltrePersonaliseBis $secondFiltre): self
{
if (!$this->secondFiltres->contains($secondFiltre)) {
$this->secondFiltres[] = $secondFiltre;
}
return $this;
}
public function removeSecondFiltre(FiltrePersonaliseBis $secondFiltre): self
{
if ($this->secondFiltres->contains($secondFiltre)) {
$this->secondFiltres->removeElement($secondFiltre);
}
return $this;
}
/**
* @return Collection|Notice[]
*/
public function getNotices(): Collection
{
return $this->notices;
}
public function addNotice(Notice $notice): self
{
if (!$this->notices->contains($notice)) {
$this->notices[] = $notice;
}
return $this;
}
public function removeNotice(Notice $notice): self
{
if ($this->notices->contains($notice)) {
$this->notices->removeElement($notice);
}
return $this;
}
/**
* @return Collection|Video[]
*/
public function getVideos(): Collection
{
return $this->videos;
}
public function addVideo(Video $video): self
{
if (!$this->videos->contains($video)) {
$this->videos[] = $video;
}
return $this;
}
public function removeVideo(Video $video): self
{
if ($this->videos->contains($video)) {
$this->videos->removeElement($video);
}
return $this;
}
public function getConfigurateur(): ?Configurateur
{
return $this->configurateur;
}
public function setConfigurateur(?Configurateur $configurateur): self
{
$this->configurateur = $configurateur;
return $this;
}
public function getPreconfigUrlKey(): ?string
{
return $this->preconfigUrlKey;
}
public function setPreconfigUrlKey(?string $preconfigUrlKey): self
{
$this->preconfigUrlKey = $preconfigUrlKey;
return $this;
}
/**
* @return Collection|ProfilGeometrie[]
*/
public function getProfilGeometries(): Collection
{
return $this->profilGeometries;
}
public function addProfilGeometry(ProfilGeometrie $profilGeometry): self
{
if (!$this->profilGeometries->contains($profilGeometry)) {
$this->profilGeometries[] = $profilGeometry;
$profilGeometry->addProduit($this);
}
return $this;
}
public function removeProfilGeometry(ProfilGeometrie $profilGeometry): self
{
if ($this->profilGeometries->contains($profilGeometry)) {
$this->profilGeometries->removeElement($profilGeometry);
$profilGeometry->removeProduit($this);
}
return $this;
}
/**
* @return Collection|RemplissageNuancier[]
*/
public function getRemplissageNuanciers(): Collection
{
return $this->remplissageNuanciers;
}
public function addRemplissageNuancier(RemplissageNuancier $remplissageNuancier): self
{
if (!$this->remplissageNuanciers->contains($remplissageNuancier)) {
$this->remplissageNuanciers[] = $remplissageNuancier;
$remplissageNuancier->addProduit($this);
}
return $this;
}
public function removeRemplissageNuancier(RemplissageNuancier $remplissageNuancier): self
{
if ($this->remplissageNuanciers->contains($remplissageNuancier)) {
$this->remplissageNuanciers->removeElement($remplissageNuancier);
$remplissageNuancier->removeProduit($this);
}
return $this;
}
/**
* @return Collection<int, SousFamille>
*/
public function getSubFamille(): Collection
{
return $this->subFamille;
}
public function addSubFamille(SousFamille $subFamille): self
{
if (!$this->subFamille->contains($subFamille)) {
$this->subFamille[] = $subFamille;
}
return $this;
}
public function removeSubFamille(SousFamille $subFamille): self
{
$this->subFamille->removeElement($subFamille);
return $this;
}
}