src/Entity/Produit.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProduitRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ProduitRepository::class)
  10.  */
  11. class Produit
  12. {
  13.     public const EXPORT_VENTE_FIELDS = [
  14.         'produit' => 'Produit',
  15.         'stock' => 'Stock',
  16.         'vente' => 'Ventes'
  17.     ];
  18.     public const EXPORT_IMEIS_DELETED_FIELDS = [
  19.         'imei' => 'IMEI',
  20.         'produit' => 'Produit',
  21.         'raison' => 'Raison',
  22.     ];
  23.     public const EXPORT_STOCK_PER_SIEGE_FIELDS = [
  24.         'siege' => 'Produit',
  25.         'stock' => 'Stock'
  26.     ];
  27.     public const EXPORT_VENTE_PER_SIEGE_FIELDS = [
  28.         'siege' => 'Produit',
  29.         'vente' => 'Vente'
  30.     ];
  31.     public const LOGO_ALLOWED_MIMETYPES = [
  32.         'png' => 'image/png',
  33.         'jpg' => 'image/jpeg'
  34.     ];
  35.     public const CORREPONDANCE_PRODUITS = [
  36.         '4895180798498' => 'TERMINAL INFINIX Hot 30i 128 8 In Store',
  37.         '4401240431384' => 'TERMINAL INFINIX HOT 40i 4/128GB In Store',
  38.         '4895180783593' => 'TERMINAL INFINIX Note 12 128 4 In Store',
  39.         '4895180781339' => 'TERMINAL INFINIX Note 12i 128 4 In Store',
  40.         '4895180760174' => 'TERMINAL INFINIX SMART 6 In Store',
  41.         '4895180797279' => 'TERMINAL INFINIX SMART 7 In Store',
  42.         '4894947010392' => 'TERMINAL INFINIX SMART 8 In Store',
  43.         '4895180797538' => 'TERMINAL ITEL A04 In Store',
  44.         '4895180796876' => 'TERMINAL ITEL P40 In Store',
  45.         '89497010538' => 'TERMINAL TECNO POP8 4/128GB IN STORE',
  46.         '4895180798153' => 'TERMINAL TECNO SPARK 10 C 4 128GB In Store',
  47.         '4894947011559' => 'TERMINAL TECNO SPARK 20 8 256GB IN STORE',
  48.     ];
  49.     /**
  50.      * @ORM\Id
  51.      * @ORM\GeneratedValue
  52.      * @ORM\Column(type="integer")
  53.      */
  54.     private $id;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $numero;
  59.     /**
  60.      * @ORM\Column(type="string", length=255)
  61.      */
  62.     private $nom;
  63.     /**
  64.      * @ORM\Column(type="text", nullable=true)
  65.      * @
  66.      */
  67.     private $description;
  68.     /**
  69.      * @ORM\OneToMany(targetEntity=Devis::class, mappedBy="produit", orphanRemoval=false)
  70.      */
  71.     private $devis;
  72.     /**
  73.      * @ORM\Column(type="string", length=255)
  74.      */
  75.     private $codeProduit;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $logo;
  80.     /**
  81.      * @ORM\Column(type="float")
  82.      * @Assert\GreaterThan(0.0, message="Le prix doit être superieur à 0")
  83.      */
  84.     private $prixDeVente;
  85.     /**
  86.      * @ORM\Column(type="string", length=255, nullable=true)
  87.      */
  88.     private $etat;
  89.     /**
  90.      * @ORM\Column(type="string", length=255)
  91.      */
  92.     private $codeBarre;
  93.     /**
  94.      * @ORM\OneToMany(targetEntity=ImageProduit::class, mappedBy="produit")
  95.      */
  96.     private $imageProduits;
  97.     /**
  98.      * @ORM\OneToMany(targetEntity=Stock::class, mappedBy="produit")
  99.      */
  100.     private $stocks;
  101.     /**
  102.      * @ORM\Column(type="string", length=255 , nullable=true)
  103.      */
  104.     private $apn;
  105.     /**
  106.      * @ORM\Column(type="string", length=255, nullable=true)
  107.      */
  108.     private $rom;
  109.     /**
  110.      * @ORM\Column(type="integer", nullable=true)
  111.      */
  112.     private $ram;
  113.     /**
  114.      * @ORM\Column(type="string", length=255, nullable=true)
  115.      */
  116.     private $imei;
  117.     /**
  118.      * @ORM\Column(type="string", length=255, nullable=true)
  119.      */
  120.     private $producer;
  121.     /**
  122.      * @ORM\Column(type="string", length=255, nullable=true)
  123.      */
  124.     private $model;
  125.     /**
  126.      * @ORM\Column(type="string", length=255, nullable=true)
  127.      */
  128.     private $realeaseYear;
  129.     /**
  130.      * @ORM\Column(type="string", length=255, nullable=true)
  131.      */
  132.     private $os;
  133.     /**
  134.      * @ORM\Column(type="string", length=255, nullable=true)
  135.      */
  136.     private $chipset;
  137.     /**
  138.      * @ORM\Column(type="string", length=255, nullable=true)
  139.      */
  140.     private $numberCpuCore;
  141.     /**
  142.      * @ORM\Column(type="string", length=255, nullable=true)
  143.      */
  144.     private $internalMemory;
  145.     /**
  146.      * @ORM\Column(type="string", length=255, nullable=true)
  147.      */
  148.     private $memoryCardType;
  149.     /**
  150.      * @ORM\Column(type="string", length=255, nullable=true)
  151.      */
  152.     private $gpuName;
  153.     /**
  154.      * @ORM\Column(type="string", length=255, nullable=true)
  155.      */
  156.     private $gpuClock;
  157.     /**
  158.      * @ORM\Column(type="string", length=255, nullable=true)
  159.      */
  160.     private $availableColors;
  161.     /**
  162.      * @ORM\Column(type="string", length=255, nullable=true)
  163.      */
  164.     private $width;
  165.     /**
  166.      * @ORM\Column(type="string", length=255, nullable=true)
  167.      */
  168.     private $height;
  169.     /**
  170.      * @ORM\Column(type="string", length=255, nullable=true)
  171.      */
  172.     private $thickness;
  173.     /**
  174.      * @ORM\Column(type="string", length=255, nullable=true)
  175.      */
  176.     private $weight;
  177.     /**
  178.      * @ORM\Column(type="string", length=255, nullable=true)
  179.      */
  180.     private $usbConnectorType;
  181.     /**
  182.      * @ORM\Column(type="string", length=255, nullable=true)
  183.      */
  184.     private $usbVersion;
  185.     /**
  186.      * @ORM\Column(type="string", length=255, nullable=true)
  187.      */
  188.     private $builtInWifi;
  189.     /**
  190.      * @ORM\Column(type="string", length=255, nullable=true)
  191.      */
  192.     private $wifiVersion;
  193.     /**
  194.      * @ORM\Column(type="string", length=255, nullable=true)
  195.      */
  196.     private $wifiFeatures;
  197.     /**
  198.      * @ORM\Column(type="string", length=255, nullable=true)
  199.      */
  200.     private $builtInBluetooth;
  201.     /**
  202.      * @ORM\Column(type="string", length=255, nullable=true)
  203.      */
  204.     private $bluetoothFeatures;
  205.     /**
  206.      * @ORM\Column(type="string", length=255, nullable=true)
  207.      */
  208.     private $bluetoothVersion;
  209.     /**
  210.      * @ORM\Column(type="string", length=255, nullable=true)
  211.      */
  212.     private $builtInNfc;
  213.     /**
  214.      * @ORM\Column(type="string", length=255, nullable=true)
  215.      */
  216.     private $builtInGps;
  217.     /**
  218.      * @ORM\Column(type="string", length=255, nullable=true)
  219.      */
  220.     private $displayType;
  221.     /**
  222.      * @ORM\Column(type="string", length=255, nullable=true)
  223.      */
  224.     private $displayDiagonal;
  225.     /**
  226.      * @ORM\Column(type="string", length=255, nullable=true)
  227.      */
  228.     private $displayResolution;
  229.     /**
  230.      * @ORM\Column(type="string", length=255, nullable=true)
  231.      */
  232.     private $displayScreenToBodyRatio;
  233.     /**
  234.      * @ORM\Column(type="string", length=255, nullable=true)
  235.      */
  236.     private $displayPixelDensity;
  237.     /**
  238.      * @ORM\Column(type="string", length=255, nullable=true)
  239.      */
  240.     private $displayColors;
  241.     /**
  242.      * @ORM\Column(type="string", length=255, nullable=true)
  243.      */
  244.     private $otherDisplayFeatures;
  245.     /**
  246.      * @ORM\Column(type="string", length=255, nullable=true)
  247.      */
  248.     private $mainCameraResolution;
  249.     /**
  250.      * @ORM\Column(type="string", length=255, nullable=true)
  251.      */
  252.     private $mainCameraFeatures;
  253.     /**
  254.      * @ORM\Column(type="string", length=255, nullable=true)
  255.      */
  256.     private $selfieCameraResolution;
  257.     /**
  258.      * @ORM\Column(type="string", length=255, nullable=true)
  259.      */
  260.     private $batteryCapacity;
  261.     /**
  262.      * @ORM\Column(type="string", length=255, nullable=true)
  263.      */
  264.     private $batteryType;
  265.     /**
  266.      * @ORM\Column(type="string", length=255, nullable=true)
  267.      */
  268.     private $removaleBattery;
  269.     /**
  270.      * @ORM\OneToMany(targetEntity=ProduitIMEI::class, mappedBy="produit")
  271.      */
  272.     private $produitIMEIs;
  273.     /**
  274.      * @ORM\OneToMany(targetEntity=FactureProduit::class, mappedBy="produit")
  275.      */
  276.     private $factureProduits;
  277.     /**
  278.      * @ORM\OneToMany(targetEntity=BLProduit::class, mappedBy="produit")
  279.      */
  280.     private $bLProduits;
  281.     /**
  282.      * @ORM\OneToMany(targetEntity=ProduitTransferer::class, mappedBy="produit")
  283.      */
  284.     private $produitTransferers;
  285.     /**
  286.      * @ORM\Column(type="float", nullable=true)
  287.      */
  288.     private $royalties;
  289.     private $totalStock 0;
  290.     private $totalVente 0;
  291.     /**
  292.      * @ORM\OneToMany(targetEntity=Changeroyalties::class, mappedBy="produit")
  293.      */
  294.     private $changeroyalties;
  295.     /**
  296.      * @ORM\ManyToOne(targetEntity=DetailCommande::class, inversedBy="produit")
  297.      */
  298.     private $detailCommande;
  299.     /**
  300.      * @ORM\OneToMany(targetEntity=DetailCommande::class, mappedBy="produit")
  301.      */
  302.     private $detailCommandes;
  303.     public function __construct()
  304.     {
  305.         $this->devis = new ArrayCollection();
  306.         $this->imageProduits = new ArrayCollection();
  307.         $this->stocks = new ArrayCollection();
  308.         $this->produitIMEIs = new ArrayCollection();
  309.         $this->factureProduits = new ArrayCollection();
  310.         $this->bLProduits = new ArrayCollection();
  311.         $this->produitTransferers = new ArrayCollection();
  312.         $this->changeroyalties = new ArrayCollection();
  313.         $this->detailCommandes = new ArrayCollection();
  314.     }
  315.     public function getId(): ?int
  316.     {
  317.         return $this->id;
  318.     }
  319.     public function getNumero(): ?string
  320.     {
  321.         return $this->numero;
  322.     }
  323.     public function setNumero(string $numero): self
  324.     {
  325.         $this->numero $numero;
  326.         return $this;
  327.     }
  328.     public function getNom(): ?string
  329.     {
  330.         return $this->nom;
  331.     }
  332.     public function setNom(string $nom): self
  333.     {
  334.         $this->nom $nom;
  335.         return $this;
  336.     }
  337.     public function getDescription(): ?string
  338.     {
  339.         return $this->description;
  340.     }
  341.     public function setDescription(string $description): self
  342.     {
  343.         $this->description $description;
  344.         return $this;
  345.     }
  346.     /**
  347.      * @return Collection<int, Devis>
  348.      */
  349.     public function getDevis(): Collection
  350.     {
  351.         return $this->devis;
  352.     }
  353.     public function addDevi(Devis $devi): self
  354.     {
  355.         if (!$this->devis->contains($devi)) {
  356.             $this->devis[] = $devi;
  357.             $devi->setProduit($this);
  358.         }
  359.         return $this;
  360.     }
  361.     public function removeDevi(Devis $devi): self
  362.     {
  363.         if ($this->devis->removeElement($devi)) {
  364.             // set the owning side to null (unless already changed)
  365.             if ($devi->getProduit() === $this) {
  366.                 $devi->setProduit(null);
  367.             }
  368.         }
  369.         return $this;
  370.     }
  371.     public function getCodeProduit(): ?string
  372.     {
  373.         return $this->codeProduit;
  374.     }
  375.     public function setCodeProduit(string $codeProduit): self
  376.     {
  377.         $this->codeProduit $codeProduit;
  378.         return $this;
  379.     }
  380.     public function getLogo(): ?string
  381.     {
  382.         return $this->logo;
  383.     }
  384.     public function setLogo(string $logo): self
  385.     {
  386.         $this->logo $logo;
  387.         return $this;
  388.     }
  389.     public function getPrixDeVente(): ?float
  390.     {
  391.         return $this->prixDeVente;
  392.     }
  393.     public function setPrixDeVente(float $prixDeVente): self
  394.     {
  395.         $this->prixDeVente $prixDeVente;
  396.         return $this;
  397.     }
  398.     public function getEtat(): ?string
  399.     {
  400.         return $this->etat;
  401.     }
  402.     public function setEtat(string $etat): self
  403.     {
  404.         $this->etat $etat;
  405.         return $this;
  406.     }
  407.     public function getCodeBarre(): ?string
  408.     {
  409.         return $this->codeBarre;
  410.     }
  411.     public function setCodeBarre(string $codeBarre): self
  412.     {
  413.         $this->codeBarre $codeBarre;
  414.         return $this;
  415.     }
  416.     /**
  417.      * @return Collection<int, ImageProduit>
  418.      */
  419.     public function getImageProduits(): Collection
  420.     {
  421.         return $this->imageProduits;
  422.     }
  423.     public function addImageProduit(ImageProduit $imageProduit): self
  424.     {
  425.         if (!$this->imageProduits->contains($imageProduit)) {
  426.             $this->imageProduits[] = $imageProduit;
  427.             $imageProduit->setProduit($this);
  428.         }
  429.         return $this;
  430.     }
  431.     public function removeImageProduit(ImageProduit $imageProduit): self
  432.     {
  433.         if ($this->imageProduits->removeElement($imageProduit)) {
  434.             // set the owning side to null (unless already changed)
  435.             if ($imageProduit->getProduit() === $this) {
  436.                 $imageProduit->setProduit(null);
  437.             }
  438.         }
  439.         return $this;
  440.     }
  441.     /**
  442.      * @return Collection<int, Stock>
  443.      */
  444.     public function getStocks(): Collection
  445.     {
  446.         return $this->stocks;
  447.     }
  448.     public function addStock(Stock $stock): self
  449.     {
  450.         if (!$this->stocks->contains($stock)) {
  451.             $this->stocks[] = $stock;
  452.             $stock->setProduit($this);
  453.         }
  454.         return $this;
  455.     }
  456.     public function removeStock(Stock $stock): self
  457.     {
  458.         if ($this->stocks->removeElement($stock)) {
  459.             // set the owning side to null (unless already changed)
  460.             if ($stock->getProduit() === $this) {
  461.                 $stock->setProduit(null);
  462.             }
  463.         }
  464.         return $this;
  465.     }
  466.     public function getApn(): ?string
  467.     {
  468.         return $this->apn;
  469.     }
  470.     public function setApn(string $apn): self
  471.     {
  472.         $this->apn $apn;
  473.         return $this;
  474.     }
  475.     public function getRom(): ?string
  476.     {
  477.         return $this->rom;
  478.     }
  479.     public function setRom(?string $rom): self
  480.     {
  481.         $this->rom $rom;
  482.         return $this;
  483.     }
  484.     public function getRam(): ?int
  485.     {
  486.         return $this->ram;
  487.     }
  488.     public function setRam(?int $ram): self
  489.     {
  490.         $this->ram $ram;
  491.         return $this;
  492.     }
  493.     public function getImei(): ?string
  494.     {
  495.         return $this->imei;
  496.     }
  497.     public function setImei(string $imei): self
  498.     {
  499.         $this->imei $imei;
  500.         return $this;
  501.     }
  502.     /**
  503.      * Get the value of producer
  504.      */
  505.     public function getProducer()
  506.     {
  507.         return $this->producer;
  508.     }
  509.     /**
  510.      * Set the value of producer
  511.      *
  512.      * @return  self
  513.      */
  514.     public function setProducer($producer)
  515.     {
  516.         $this->producer $producer;
  517.         return $this;
  518.     }
  519.     /**
  520.      * Get the value of model
  521.      */
  522.     public function getModel()
  523.     {
  524.         return $this->model;
  525.     }
  526.     /**
  527.      * Set the value of model
  528.      *
  529.      * @return  self
  530.      */
  531.     public function setModel($model)
  532.     {
  533.         $this->model $model;
  534.         return $this;
  535.     }
  536.     /**
  537.      * Get the value of realeaseYear
  538.      */
  539.     public function getRealeaseYear()
  540.     {
  541.         return $this->realeaseYear;
  542.     }
  543.     /**
  544.      * Set the value of realeaseYear
  545.      *
  546.      * @return  self
  547.      */
  548.     public function setRealeaseYear($realeaseYear)
  549.     {
  550.         $this->realeaseYear $realeaseYear;
  551.         return $this;
  552.     }
  553.     /**
  554.      * Get the value of os
  555.      */
  556.     public function getOs()
  557.     {
  558.         return $this->os;
  559.     }
  560.     /**
  561.      * Set the value of os
  562.      *
  563.      * @return  self
  564.      */
  565.     public function setOs($os)
  566.     {
  567.         $this->os $os;
  568.         return $this;
  569.     }
  570.     /**
  571.      * Get the value of chipset
  572.      */
  573.     public function getChipset()
  574.     {
  575.         return $this->chipset;
  576.     }
  577.     /**
  578.      * Set the value of chipset
  579.      *
  580.      * @return  self
  581.      */
  582.     public function setChipset($chipset)
  583.     {
  584.         $this->chipset $chipset;
  585.         return $this;
  586.     }
  587.     /**
  588.      * Get the value of numberCpuCore
  589.      */
  590.     public function getNumberCpuCore()
  591.     {
  592.         return $this->numberCpuCore;
  593.     }
  594.     /**
  595.      * Set the value of numberCpuCore
  596.      *
  597.      * @return  self
  598.      */
  599.     public function setNumberCpuCore($numberCpuCore)
  600.     {
  601.         $this->numberCpuCore $numberCpuCore;
  602.         return $this;
  603.     }
  604.     /**
  605.      * Get the value of internalMemory
  606.      */
  607.     public function getInternalMemory()
  608.     {
  609.         return $this->internalMemory;
  610.     }
  611.     /**
  612.      * Set the value of internalMemory
  613.      *
  614.      * @return  self
  615.      */
  616.     public function setInternalMemory($internalMemory)
  617.     {
  618.         $this->internalMemory $internalMemory;
  619.         return $this;
  620.     }
  621.     /**
  622.      * Get the value of batteryCapacity
  623.      */
  624.     public function getBatteryCapacity()
  625.     {
  626.         return $this->batteryCapacity;
  627.     }
  628.     /**
  629.      * Set the value of batteryCapacity
  630.      *
  631.      * @return  self
  632.      */
  633.     public function setBatteryCapacity($batteryCapacity)
  634.     {
  635.         $this->batteryCapacity $batteryCapacity;
  636.         return $this;
  637.     }
  638.     /**
  639.      * Get the value of removaleBattery
  640.      */
  641.     public function getRemovaleBattery()
  642.     {
  643.         return $this->removaleBattery;
  644.     }
  645.     /**
  646.      * Set the value of removaleBattery
  647.      *
  648.      * @return  self
  649.      */
  650.     public function setRemovaleBattery($removaleBattery)
  651.     {
  652.         $this->removaleBattery $removaleBattery;
  653.         return $this;
  654.     }
  655.     /**
  656.      * Get the value of displayType
  657.      */
  658.     public function getDisplayType()
  659.     {
  660.         return $this->displayType;
  661.     }
  662.     /**
  663.      * Set the value of displayType
  664.      *
  665.      * @return  self
  666.      */
  667.     public function setDisplayType($displayType)
  668.     {
  669.         $this->displayType $displayType;
  670.         return $this;
  671.     }
  672.     /**
  673.      * Get the value of builtInGps
  674.      */
  675.     public function getBuiltInGps()
  676.     {
  677.         return $this->builtInGps;
  678.     }
  679.     /**
  680.      * Set the value of builtInGps
  681.      *
  682.      * @return  self
  683.      */
  684.     public function setBuiltInGps($builtInGps)
  685.     {
  686.         $this->builtInGps $builtInGps;
  687.         return $this;
  688.     }
  689.     /**
  690.      * Get the value of bluetoothVersion
  691.      */
  692.     public function getBluetoothVersion()
  693.     {
  694.         return $this->bluetoothVersion;
  695.     }
  696.     /**
  697.      * Set the value of bluetoothVersion
  698.      *
  699.      * @return  self
  700.      */
  701.     public function setBluetoothVersion($bluetoothVersion)
  702.     {
  703.         $this->bluetoothVersion $bluetoothVersion;
  704.         return $this;
  705.     }
  706.     /**
  707.      * Get the value of displayPixelDensity
  708.      */
  709.     public function getDisplayPixelDensity()
  710.     {
  711.         return $this->displayPixelDensity;
  712.     }
  713.     /**
  714.      * Set the value of displayPixelDensity
  715.      *
  716.      * @return  self
  717.      */
  718.     public function setDisplayPixelDensity($displayPixelDensity)
  719.     {
  720.         $this->displayPixelDensity $displayPixelDensity;
  721.         return $this;
  722.     }
  723.     /**
  724.      * Get the value of displayColors
  725.      */
  726.     public function getDisplayColors()
  727.     {
  728.         return $this->displayColors;
  729.     }
  730.     /**
  731.      * Set the value of displayColors
  732.      *
  733.      * @return  self
  734.      */
  735.     public function setDisplayColors($displayColors)
  736.     {
  737.         $this->displayColors $displayColors;
  738.         return $this;
  739.     }
  740.     /**
  741.      * Get the value of builtInNfc
  742.      */
  743.     public function getBuiltInNfc()
  744.     {
  745.         return $this->builtInNfc;
  746.     }
  747.     /**
  748.      * Set the value of builtInNfc
  749.      *
  750.      * @return  self
  751.      */
  752.     public function setBuiltInNfc($builtInNfc)
  753.     {
  754.         $this->builtInNfc $builtInNfc;
  755.         return $this;
  756.     }
  757.     /**
  758.      * Get the value of selfieCameraResolution
  759.      */
  760.     public function getSelfieCameraResolution()
  761.     {
  762.         return $this->selfieCameraResolution;
  763.     }
  764.     /**
  765.      * Set the value of selfieCameraResolution
  766.      *
  767.      * @return  self
  768.      */
  769.     public function setSelfieCameraResolution($selfieCameraResolution)
  770.     {
  771.         $this->selfieCameraResolution $selfieCameraResolution;
  772.         return $this;
  773.     }
  774.     /**
  775.      * Get the value of mainCameraResolution
  776.      */
  777.     public function getMainCameraResolution()
  778.     {
  779.         return $this->mainCameraResolution;
  780.     }
  781.     /**
  782.      * Set the value of mainCameraResolution
  783.      *
  784.      * @return  self
  785.      */
  786.     public function setMainCameraResolution($mainCameraResolution)
  787.     {
  788.         $this->mainCameraResolution $mainCameraResolution;
  789.         return $this;
  790.     }
  791.     /**
  792.      * Get the value of displayDiagonal
  793.      */
  794.     public function getDisplayDiagonal()
  795.     {
  796.         return $this->displayDiagonal;
  797.     }
  798.     /**
  799.      * Set the value of displayDiagonal
  800.      *
  801.      * @return  self
  802.      */
  803.     public function setDisplayDiagonal($displayDiagonal)
  804.     {
  805.         $this->displayDiagonal $displayDiagonal;
  806.         return $this;
  807.     }
  808.     /**
  809.      * Get the value of batteryType
  810.      */
  811.     public function getBatteryType()
  812.     {
  813.         return $this->batteryType;
  814.     }
  815.     /**
  816.      * Set the value of batteryType
  817.      *
  818.      * @return  self
  819.      */
  820.     public function setBatteryType($batteryType)
  821.     {
  822.         $this->batteryType $batteryType;
  823.         return $this;
  824.     }
  825.     /**
  826.      * Get the value of bluetoothFeatures
  827.      */
  828.     public function getBluetoothFeatures()
  829.     {
  830.         return $this->bluetoothFeatures;
  831.     }
  832.     /**
  833.      * Set the value of bluetoothFeatures
  834.      *
  835.      * @return  self
  836.      */
  837.     public function setBluetoothFeatures($bluetoothFeatures)
  838.     {
  839.         $this->bluetoothFeatures $bluetoothFeatures;
  840.         return $this;
  841.     }
  842.     /**
  843.      * Get the value of mainCameraFeatures
  844.      */
  845.     public function getMainCameraFeatures()
  846.     {
  847.         return $this->mainCameraFeatures;
  848.     }
  849.     /**
  850.      * Set the value of mainCameraFeatures
  851.      *
  852.      * @return  self
  853.      */
  854.     public function setMainCameraFeatures($mainCameraFeatures)
  855.     {
  856.         $this->mainCameraFeatures $mainCameraFeatures;
  857.         return $this;
  858.     }
  859.     /**
  860.      * Get the value of otherDisplayFeatures
  861.      */
  862.     public function getOtherDisplayFeatures()
  863.     {
  864.         return $this->otherDisplayFeatures;
  865.     }
  866.     /**
  867.      * Set the value of otherDisplayFeatures
  868.      *
  869.      * @return  self
  870.      */
  871.     public function setOtherDisplayFeatures($otherDisplayFeatures)
  872.     {
  873.         $this->otherDisplayFeatures $otherDisplayFeatures;
  874.         return $this;
  875.     }
  876.     /**
  877.      * Get the value of displayScreenToBodyRatio
  878.      */
  879.     public function getDisplayScreenToBodyRatio()
  880.     {
  881.         return $this->displayScreenToBodyRatio;
  882.     }
  883.     /**
  884.      * Set the value of displayScreenToBodyRatio
  885.      *
  886.      * @return  self
  887.      */
  888.     public function setDisplayScreenToBodyRatio($displayScreenToBodyRatio)
  889.     {
  890.         $this->displayScreenToBodyRatio $displayScreenToBodyRatio;
  891.         return $this;
  892.     }
  893.     /**
  894.      * Get the value of displayResolution
  895.      */
  896.     public function getDisplayResolution()
  897.     {
  898.         return $this->displayResolution;
  899.     }
  900.     /**
  901.      * Set the value of displayResolution
  902.      *
  903.      * @return  self
  904.      */
  905.     public function setDisplayResolution($displayResolution)
  906.     {
  907.         $this->displayResolution $displayResolution;
  908.         return $this;
  909.     }
  910.     /**
  911.      * Get the value of builtInBluetooth
  912.      */
  913.     public function getBuiltInBluetooth()
  914.     {
  915.         return $this->builtInBluetooth;
  916.     }
  917.     /**
  918.      * Set the value of builtInBluetooth
  919.      *
  920.      * @return  self
  921.      */
  922.     public function setBuiltInBluetooth($builtInBluetooth)
  923.     {
  924.         $this->builtInBluetooth $builtInBluetooth;
  925.         return $this;
  926.     }
  927.     /**
  928.      * Get the value of wifiFeatures
  929.      */
  930.     public function getWifiFeatures()
  931.     {
  932.         return $this->wifiFeatures;
  933.     }
  934.     /**
  935.      * Set the value of wifiFeatures
  936.      *
  937.      * @return  self
  938.      */
  939.     public function setWifiFeatures($wifiFeatures)
  940.     {
  941.         $this->wifiFeatures $wifiFeatures;
  942.         return $this;
  943.     }
  944.     /**
  945.      * Get the value of wifiVersion
  946.      */
  947.     public function getWifiVersion()
  948.     {
  949.         return $this->wifiVersion;
  950.     }
  951.     /**
  952.      * Set the value of wifiVersion
  953.      *
  954.      * @return  self
  955.      */
  956.     public function setWifiVersion($wifiVersion)
  957.     {
  958.         $this->wifiVersion $wifiVersion;
  959.         return $this;
  960.     }
  961.     /**
  962.      * @return Collection<int, ProduitIMEI>
  963.      */
  964.     public function getProduitIMEIs(): Collection
  965.     {
  966.         return $this->produitIMEIs;
  967.     }
  968.     public function addProduitIMEI(ProduitIMEI $produitIMEI): self
  969.     {
  970.         if (!$this->produitIMEIs->contains($produitIMEI)) {
  971.             $this->produitIMEIs[] = $produitIMEI;
  972.             $produitIMEI->setProduit($this);
  973.         }
  974.         return $this;
  975.     }
  976.     /**
  977.      * Get the value of builtInWifi
  978.      */
  979.     public function getBuiltInWifi()
  980.     {
  981.         return $this->builtInWifi;
  982.     }
  983.     /**
  984.      * Set the value of builtInWifi
  985.      *
  986.      * @return  self
  987.      */
  988.     public function setBuiltInWifi($builtInWifi)
  989.     {
  990.         $this->builtInWifi $builtInWifi;
  991.         return $this;
  992.     }
  993.     public function removeProduitIMEI(ProduitIMEI $produitIMEI): self
  994.     {
  995.         if ($this->produitIMEIs->removeElement($produitIMEI)) {
  996.             // set the owning side to null (unless already changed)
  997.             if ($produitIMEI->getProduit() === $this) {
  998.                 $produitIMEI->setProduit(null);
  999.             }
  1000.         }
  1001.         return $this;
  1002.     }
  1003.     /**
  1004.      * Get the value of usbVersion
  1005.      */
  1006.     public function getUsbVersion()
  1007.     {
  1008.         return $this->usbVersion;
  1009.     }
  1010.     /**
  1011.      * Set the value of usbVersion
  1012.      *
  1013.      * @return  self
  1014.      */
  1015.     public function setUsbVersion($usbVersion)
  1016.     {
  1017.         $this->usbVersion $usbVersion;
  1018.         return $this;
  1019.     }
  1020.     /**
  1021.      * Get the value of usbConnectorType
  1022.      */
  1023.     public function getUsbConnectorType()
  1024.     {
  1025.         return $this->usbConnectorType;
  1026.     }
  1027.     /**
  1028.      * Set the value of usbConnectorType
  1029.      *
  1030.      * @return  self
  1031.      */
  1032.     public function setUsbConnectorType($usbConnectorType)
  1033.     {
  1034.         $this->usbConnectorType $usbConnectorType;
  1035.         return $this;
  1036.     }
  1037.     /**
  1038.      * Get the value of weight
  1039.      */
  1040.     public function getWeight()
  1041.     {
  1042.         return $this->weight;
  1043.     }
  1044.     /**
  1045.      * Set the value of weight
  1046.      *
  1047.      * @return  self
  1048.      */
  1049.     public function setWeight($weight)
  1050.     {
  1051.         $this->weight $weight;
  1052.         return $this;
  1053.     }
  1054.     /**
  1055.      * Get the value of thickness
  1056.      */
  1057.     public function getThickness()
  1058.     {
  1059.         return $this->thickness;
  1060.     }
  1061.     /**
  1062.      * Set the value of thickness
  1063.      *
  1064.      * @return  self
  1065.      */
  1066.     public function setThickness($thickness)
  1067.     {
  1068.         $this->thickness $thickness;
  1069.         return $this;
  1070.     }
  1071.     /**
  1072.      * Get the value of height
  1073.      */
  1074.     public function getHeight()
  1075.     {
  1076.         return $this->height;
  1077.     }
  1078.     /**
  1079.      * Set the value of height
  1080.      *
  1081.      * @return  self
  1082.      */
  1083.     public function setHeight($height)
  1084.     {
  1085.         $this->height $height;
  1086.         return $this;
  1087.     }
  1088.     /**
  1089.      * Get the value of width
  1090.      */
  1091.     public function getWidth()
  1092.     {
  1093.         return $this->width;
  1094.     }
  1095.     /**
  1096.      * Set the value of width
  1097.      *
  1098.      * @return  self
  1099.      */
  1100.     public function setWidth($width)
  1101.     {
  1102.         $this->width $width;
  1103.         return $this;
  1104.     }
  1105.     /**
  1106.      * Get the value of availableColors
  1107.      */
  1108.     public function getAvailableColors()
  1109.     {
  1110.         return $this->availableColors;
  1111.     }
  1112.     /**
  1113.      * Set the value of availableColors
  1114.      *
  1115.      * @return  self
  1116.      */
  1117.     public function setAvailableColors($availableColors)
  1118.     {
  1119.         $this->availableColors $availableColors;
  1120.         return $this;
  1121.     }
  1122.     /**
  1123.      * Get the value of gpuClock
  1124.      */
  1125.     public function getGpuClock()
  1126.     {
  1127.         return $this->gpuClock;
  1128.     }
  1129.     /**
  1130.      * Set the value of gpuClock
  1131.      *
  1132.      * @return  self
  1133.      */
  1134.     public function setGpuClock($gpuClock)
  1135.     {
  1136.         $this->gpuClock $gpuClock;
  1137.         return $this;
  1138.     }
  1139.     /**
  1140.      * Get the value of gpuName
  1141.      */
  1142.     public function getGpuName()
  1143.     {
  1144.         return $this->gpuName;
  1145.     }
  1146.     /**
  1147.      * Set the value of gpuName
  1148.      *
  1149.      * @return  self
  1150.      */
  1151.     public function setGpuName($gpuName)
  1152.     {
  1153.         $this->gpuName $gpuName;
  1154.         return $this;
  1155.     }
  1156.     /**
  1157.      * Get the value of memoryCardType
  1158.      */
  1159.     public function getMemoryCardType()
  1160.     {
  1161.         return $this->memoryCardType;
  1162.     }
  1163.     /**
  1164.      * Set the value of memoryCardType
  1165.      *
  1166.      * @return  self
  1167.      */
  1168.     public function setMemoryCardType($memoryCardType)
  1169.     {
  1170.         $this->memoryCardType $memoryCardType;
  1171.         return $this;
  1172.     }
  1173.     public static function loadByData(array $dataProduit $produit null)
  1174.     {
  1175.         $produit null != $produit $produit : new Produit();
  1176.         $apn = [];
  1177.         $typeapn "";
  1178.         foreach ($data as $d) {
  1179.             $key $d[0];
  1180.             switch ($key) {
  1181.                 case 'Main Camera':
  1182.                     $typeapn 'mc';
  1183.                     break;
  1184.                 case 'Selfie Camera':
  1185.                     $typeapn 'sc';
  1186.                     break;
  1187.                 case 'IMEI Number'// IMEI
  1188.                     if (isset($d[1])) {
  1189.                         $produit->setImei($d[1]);
  1190.                     }
  1191.                     break;
  1192.                 case 'Producer'// Producer
  1193.                     if (isset($d[1])) {
  1194.                         $produit->setProducer($d[1]);
  1195.                     }
  1196.                     break;
  1197.                 case 'Model'// Model
  1198.                     if (isset($d[1])) {
  1199.                         $produit->setModel($d[1]);
  1200.                     }
  1201.                     break;
  1202.                 case 'Release year'// Release year
  1203.                     if (isset($d[1])) {
  1204.                         $produit->setRealeaseYear($d[1]);
  1205.                     }
  1206.                     break;
  1207.                 case 'Operating System'// OS
  1208.                     if (isset($d[1])) {
  1209.                         $produit->setOs($d[1]);
  1210.                     }
  1211.                     break;
  1212.                 case 'Chipset'// Chipset
  1213.                     if (isset($d[1])) {
  1214.                         $produit->setChipset($d[1]);
  1215.                     }
  1216.                     break;
  1217.                 case 'Number of CPU Cores'// Number of CPU Cores
  1218.                     if (isset($d[1])) {
  1219.                         $produit->setNumberCpuCore($d[1]);
  1220.                     }
  1221.                     break;
  1222.                 case 'RAM'// Ram
  1223.                     if (isset($d[1])) {
  1224.                         $produit->setRam(str_replace(' GB'''$d[1]));
  1225.                     }
  1226.                     break;
  1227.                 case 'Internal Memory'// Internal Memory
  1228.                     if (isset($d[1])) {
  1229.                         $produit->setInternalMemory($d[1]);
  1230.                         $produit->setRom($d[1]);
  1231.                     }
  1232.                     break;
  1233.                 case 'Memory Card Type'// Memory Card Type
  1234.                     if (isset($d[1])) {
  1235.                         $produit->setMemoryCardType($d[1]);
  1236.                     }
  1237.                     break;
  1238.                 case 'GPU Name'// GPU Name
  1239.                     if (isset($d[1])) {
  1240.                         $produit->setGpuName($d[1]);
  1241.                     }
  1242.                     break;
  1243.                 case 'GPU Clock'// GPU Clock
  1244.                     if (isset($d[1])) {
  1245.                         $produit->setGpuClock($d[1]);
  1246.                     }
  1247.                     break;
  1248.                 case 'Available Colors'// Available colors
  1249.                     if (isset($d[1])) {
  1250.                         $produit->setAvailableColors($d[1]);
  1251.                     }
  1252.                     break;
  1253.                 case 'Width'// Width
  1254.                     if (isset($d[1])) {
  1255.                         $produit->setWidth($d[1]);
  1256.                     }
  1257.                     break;
  1258.                 case 'Height'// Height
  1259.                     if (isset($d[1])) {
  1260.                         $produit->setHeight($d[1]);
  1261.                     }
  1262.                     break;
  1263.                 case 'Thickness'// Thickness
  1264.                     if (isset($d[1])) {
  1265.                         $produit->setThickness($d[1]);
  1266.                     }
  1267.                     break;
  1268.                 case 'Weight'// Weight
  1269.                     if (isset($d[1])) {
  1270.                         $produit->setWeight($d[1]);
  1271.                     }
  1272.                     break;
  1273.                 case 'USB Conector Type'// USB Conector Type
  1274.                     if (isset($d[1])) {
  1275.                         $produit->setUsbConnectorType($d[1]);
  1276.                     }
  1277.                     break;
  1278.                 case 'USB Version'// USB Version
  1279.                     if (isset($d[1])) {
  1280.                         $produit->setUsbVersion($d[1]);
  1281.                     }
  1282.                     break;
  1283.                 case 'Built-in WiFi'// Built-in WiFi
  1284.                     if (isset($d[1])) {
  1285.                         $produit->setBuiltInWifi($d[1]);
  1286.                     }
  1287.                     break;
  1288.                 case 'WiFi Version'// WiFi Version
  1289.                     if (isset($d[1])) {
  1290.                         $produit->setWifiVersion($d[1]);
  1291.                     }
  1292.                     break;
  1293.                 case 'WiFi Features'// WiFi Features
  1294.                     if (isset($d[1])) {
  1295.                         $produit->setWifiFeatures($d[1]);
  1296.                     }
  1297.                     break;
  1298.                 case 'Built-in bluetooth'// Built-in bluetooth
  1299.                     if (isset($d[1])) {
  1300.                         $produit->setBuiltInBluetooth($d[1]);
  1301.                     }
  1302.                     break;
  1303.                 case 'Bluetooth Features'// Bluetooth Features
  1304.                     if (isset($d[1])) {
  1305.                         $produit->setBluetoothFeatures($d[1]);
  1306.                     }
  1307.                     break;
  1308.                 case 'Bluetooth Version'// Bluetooth Version
  1309.                     if (isset($d[1])) {
  1310.                         $produit->setBluetoothVersion($d[1]);
  1311.                     }
  1312.                     break;
  1313.                 case 'Built-in NFC'// Built-in NFC
  1314.                     if (isset($d[1])) {
  1315.                         $produit->setBuiltInNfc($d[1]);
  1316.                     }
  1317.                     break;
  1318.                 case 'Built-in GPS'// Built-in Gps
  1319.                     if (isset($d[1])) {
  1320.                         $produit->setBuiltInGps($d[1]);
  1321.                     }
  1322.                     break;
  1323.                 case 'Type'// Display type
  1324.                     if (isset($d[1])) {
  1325.                         $produit->setDisplayType($d[1]);
  1326.                     }
  1327.                     break;
  1328.                 case 'Diagonal'// Display diagonal
  1329.                     if (isset($d[1])) {
  1330.                         $produit->setDisplayDiagonal($d[1]);
  1331.                     }
  1332.                     break;
  1333.                 case 'Resolution'// Display resolution
  1334.                     if ('mc'==$typeapn) {
  1335.                         if (isset($d[1])) {
  1336.                             $produit->setMainCameraResolution($d[1]);
  1337.                             $apn[] = $d[1];
  1338.                         }
  1339.                     } elseif ('sc'==$typeapn) {
  1340.                         if (isset($d[1])) {
  1341.                             $produit->setSelfieCameraResolution($d[1]);
  1342.                             $apn[] = $d[1];
  1343.                         }
  1344.                     } else {
  1345.                         if (isset($d[1])) {
  1346.                             $produit->setDisplayResolution($d[1]);
  1347.                         }
  1348.                     }
  1349.                     break;
  1350.                 case 'Screen-to-body ratio'// Display Screen-to-body ratio
  1351.                     if (isset($d[1])) {
  1352.                         $produit->setDisplayScreenToBodyRatio($d[1]);
  1353.                     }
  1354.                     break;
  1355.                 case 'Pixel density'// Display Pixel density
  1356.                     if (isset($d[1])) {
  1357.                         $produit->setDisplayPixelDensity($d[1]);
  1358.                     }
  1359.                     break;
  1360.                 case 'Colors'// Display colors
  1361.                     if (isset($d[1])) {
  1362.                         $produit->setDisplayColors($d[1]);
  1363.                     }
  1364.                     break;
  1365.                 case 'Other display Features'// Other display Features
  1366.                     if (isset($d[1])) {
  1367.                         $produit->setOtherDisplayFeatures($d[1]);
  1368.                     }
  1369.                     break;
  1370.                 // case 'Resolution': // Main camera resolution
  1371.                 //     if(isset($d[1])) {
  1372.                 //         $produit->setMainCameraResolution($d[1]);
  1373.                 //         $apn[] = $d[1];
  1374.                 //     }
  1375.                 //     break;
  1376.                 case 'Features'// Main camera features
  1377.                     if (isset($d[1])) {
  1378.                         $produit->setMainCameraFeatures($d[1]);
  1379.                     }
  1380.                     break;
  1381.                 // case 'Resolution': // Selfie camera resolution
  1382.                 //     if(isset($d[1])) {
  1383.                 //         $produit->setSelfieCameraResolution($d[1]);
  1384.                 //         $apn[] = $d[1];
  1385.                 //     }
  1386.                 //     break;
  1387.                 case 'Capacity'// Battery capacity
  1388.                     if (isset($d[1])) {
  1389.                         $produit->setBatteryCapacity($d[1]);
  1390.                     }
  1391.                     break;
  1392.                 case 'Type'// Battery type
  1393.                     if (isset($d[1])) {
  1394.                         $produit->setBatteryType($d[1]);
  1395.                     }
  1396.                     break;
  1397.                 case 'Removable battery'// Removable battery
  1398.                     if (isset($d[1])) {
  1399.                         $produit->setRemovaleBattery($d[1]);
  1400.                     }
  1401.                     break;
  1402.                 default:
  1403.                     # code...
  1404.                     break;
  1405.             }
  1406.         }
  1407.         $produit->setNom($data[3][1] . ' ' $data[2][1]);
  1408.         $produit->setApn(implode('/'$apn));
  1409.         return $produit;
  1410.     }
  1411.     /**
  1412.      * @return Collection<int, FactureProduit>
  1413.      */
  1414.     public function getFactureProduits(): Collection
  1415.     {
  1416.         return $this->factureProduits;
  1417.     }
  1418.     public function addFactureProduit(FactureProduit $factureProduit): self
  1419.     {
  1420.         if (!$this->factureProduits->contains($factureProduit)) {
  1421.             $this->factureProduits[] = $factureProduit;
  1422.             $factureProduit->setProduit($this);
  1423.         }
  1424.         return $this;
  1425.     }
  1426.     public function removeFactureProduit(FactureProduit $factureProduit): self
  1427.     {
  1428.         if ($this->factureProduits->removeElement($factureProduit)) {
  1429.             // set the owning side to null (unless already changed)
  1430.             if ($factureProduit->getProduit() === $this) {
  1431.                 $factureProduit->setProduit(null);
  1432.             }
  1433.         }
  1434.         return $this;
  1435.     }
  1436.     /**
  1437.      * @return Collection<int, BLProduit>
  1438.      */
  1439.     public function getBLProduits(): Collection
  1440.     {
  1441.         return $this->bLProduits;
  1442.     }
  1443.     public function addBLProduit(BLProduit $bLProduit): self
  1444.     {
  1445.         if (!$this->bLProduits->contains($bLProduit)) {
  1446.             $this->bLProduits[] = $bLProduit;
  1447.             $bLProduit->setProduit($this);
  1448.         }
  1449.         return $this;
  1450.     }
  1451.     public function removeBLProduit(BLProduit $bLProduit): self
  1452.     {
  1453.         if ($this->bLProduits->removeElement($bLProduit)) {
  1454.             // set the owning side to null (unless already changed)
  1455.             if ($bLProduit->getProduit() === $this) {
  1456.                 $bLProduit->setProduit(null);
  1457.             }
  1458.         }
  1459.         return $this;
  1460.     }
  1461.     /**
  1462.      * @return Collection<int, ProduitTransferer>
  1463.      */
  1464.     public function getProduitTransferers(): Collection
  1465.     {
  1466.         return $this->produitTransferers;
  1467.     }
  1468.     public function addProduitTransferer(ProduitTransferer $produitTransferer): self
  1469.     {
  1470.         if (!$this->produitTransferers->contains($produitTransferer)) {
  1471.             $this->produitTransferers[] = $produitTransferer;
  1472.             $produitTransferer->setProduit($this);
  1473.         }
  1474.         return $this;
  1475.     }
  1476.     public function removeProduitTransferer(ProduitTransferer $produitTransferer): self
  1477.     {
  1478.         if ($this->produitTransferers->removeElement($produitTransferer)) {
  1479.             // set the owning side to null (unless already changed)
  1480.             if ($produitTransferer->getProduit() === $this) {
  1481.                 $produitTransferer->setProduit(null);
  1482.             }
  1483.         }
  1484.         return $this;
  1485.     }
  1486.     public function getRoyalties(): ?float
  1487.     {
  1488.         return $this->royalties;
  1489.     }
  1490.     public function setRoyalties(?float $royalties): self
  1491.     {
  1492.         $this->royalties $royalties;
  1493.         return $this;
  1494.     }
  1495.     /**
  1496.      * Get the value of totalStock
  1497.      */
  1498.     public function getTotalStock()
  1499.     {
  1500.         return $this->totalStock;
  1501.     }
  1502.     /**
  1503.      * Set the value of totalStock
  1504.      *
  1505.      * @return  self
  1506.      */
  1507.     public function setTotalStock($totalStock)
  1508.     {
  1509.         $this->totalStock $totalStock;
  1510.         return $this;
  1511.     }
  1512.     /**
  1513.      * Get the value of totalVente
  1514.      */
  1515.     public function getTotalVente()
  1516.     {
  1517.         return $this->totalVente;
  1518.     }
  1519.     /**
  1520.      * Set the value of totalVente
  1521.      *
  1522.      * @return  self
  1523.      */
  1524.     public function setTotalVente($totalVente)
  1525.     {
  1526.         $this->totalVente $totalVente;
  1527.         return $this;
  1528.     }
  1529.     /**
  1530.      * @return Collection<int, Changeroyalties>
  1531.      */
  1532.     public function getChangeroyalties(): Collection
  1533.     {
  1534.         return $this->changeroyalties;
  1535.     }
  1536.     public function addChangeroyalty(Changeroyalties $changeroyalty): self
  1537.     {
  1538.         if (!$this->changeroyalties->contains($changeroyalty)) {
  1539.             $this->changeroyalties[] = $changeroyalty;
  1540.             $changeroyalty->setProduit($this);
  1541.         }
  1542.         return $this;
  1543.     }
  1544.     public function removeChangeroyalty(Changeroyalties $changeroyalty): self
  1545.     {
  1546.         if ($this->changeroyalties->removeElement($changeroyalty)) {
  1547.             // set the owning side to null (unless already changed)
  1548.             if ($changeroyalty->getProduit() === $this) {
  1549.                 $changeroyalty->setProduit(null);
  1550.             }
  1551.         }
  1552.         return $this;
  1553.     }
  1554.     public function getCorrespondanceProduit($codeBarre null): string
  1555.     {
  1556.         return isset((self::CORREPONDANCE_PRODUITS)[$codeBarre]) ? (self::CORREPONDANCE_PRODUITS)[$codeBarre] : "";
  1557.     }
  1558.     public function getDetailCommande(): ?DetailCommande
  1559.     {
  1560.         return $this->detailCommande;
  1561.     }
  1562.     public function setDetailCommande(?DetailCommande $detailCommande): self
  1563.     {
  1564.         $this->detailCommande $detailCommande;
  1565.         return $this;
  1566.     }
  1567.     /**
  1568.      * @return Collection<int, DetailCommande>
  1569.      */
  1570.     public function getDetailCommandes(): Collection
  1571.     {
  1572.         return $this->detailCommandes;
  1573.     }
  1574.     public function addDetailCommande(DetailCommande $detailCommande): self
  1575.     {
  1576.         if (!$this->detailCommandes->contains($detailCommande)) {
  1577.             $this->detailCommandes[] = $detailCommande;
  1578.             $detailCommande->setProduit($this);
  1579.         }
  1580.         return $this;
  1581.     }
  1582.     public function removeDetailCommande(DetailCommande $detailCommande): self
  1583.     {
  1584.         if ($this->detailCommandes->removeElement($detailCommande)) {
  1585.             // set the owning side to null (unless already changed)
  1586.             if ($detailCommande->getProduit() === $this) {
  1587.                 $detailCommande->setProduit(null);
  1588.             }
  1589.         }
  1590.         return $this;
  1591.     }
  1592. }