src/Entity/Cuvee.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CuveeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass=CuveeRepository::class)
  11.  * @Vich\Uploadable
  12.  */
  13. class Cuvee
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $nom_domaine;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $nom_cuvee;
  29.     /**
  30.      * @ORM\Column(type="integer", nullable=true)
  31.      */
  32.     private $annee;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity=Boisson::class, inversedBy="cuvees")
  35.      * @ORM\JoinColumn(nullable=true)
  36.      */
  37.     private $type_boisson;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Region::class, inversedBy="cuvees")
  40.      * @ORM\JoinColumn(nullable=true)
  41.      */
  42.     private $region;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      */
  46.     private $teneur_alcool;
  47.     /**
  48.      * @ORM\Column(type="boolean")
  49.      */
  50.     private $allergenes_sulfite;
  51.     /**
  52.      * @ORM\Column(type="boolean")
  53.      */
  54.     private $allergenes_oeufs;
  55.     /**
  56.      * @ORM\Column(type="boolean")
  57.      */
  58.     private $allergenes_lait;
  59.     /**
  60.      * @ORM\ManyToMany(targetEntity=Label::class, inversedBy="cuvees")
  61.      */
  62.     private $labels;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     private $numero_lot;
  67.     /**
  68.      * @ORM\Column(type="integer", nullable=true)
  69.      */
  70.     private $contenance;
  71.     /**
  72.      * @ORM\Column(type="text", nullable=true)
  73.      */
  74.     private $ingredients;
  75.     /**
  76.      * @ORM\Column(type="integer", nullable=true)
  77.      */
  78.     private $energies_calories;
  79.     /**
  80.      * @ORM\Column(type="integer", nullable=true)
  81.      */
  82.     private $energies_joules;
  83.     /**
  84.      * @ORM\Column(type="integer", nullable=true)
  85.      */
  86.     private $lipides;
  87.     /**
  88.      * @ORM\Column(type="integer", nullable=true)
  89.      */
  90.     private $acide_gras;
  91.     /**
  92.      * @ORM\Column(type="integer", nullable=true)
  93.      */
  94.     private $proteines;
  95.     /**
  96.      * @ORM\Column(type="integer", nullable=true)
  97.      */
  98.     private $glucides;
  99.     /**
  100.      * @ORM\Column(type="integer", nullable=true)
  101.      */
  102.     private $sucres;
  103.     /**
  104.      * @ORM\Column(type="integer", nullable=true)
  105.      */
  106.     private $sel;
  107.     /**
  108.      * @ORM\Column(type="string", length=255, nullable=true)
  109.      */
  110.     private $photo;
  111.     /**
  112.      * @Vich\UploadableField(mapping = "produits", fileNameProperty = "photo")
  113.      */
  114.     private $photoFile;
  115.     /**
  116.      * @ORM\Column(type="string", length=255, nullable=true)
  117.      */
  118.     private $etiquette;
  119.     /**
  120.      * @Vich\UploadableField(mapping = "produits", fileNameProperty = "etiquette")
  121.      */
  122.     private $etiquetteFile;
  123.     /**
  124.      * @ORM\Column(type="string", length=255, nullable=true)
  125.      */
  126.     private $contre_etiquette;
  127.     /**
  128.      * @Vich\UploadableField(mapping = "produits", fileNameProperty = "contre_etiquette")
  129.      */
  130.     private $contre_etiquetteFile;
  131.     /**
  132.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="cuvees")
  133.      * @ORM\JoinColumn(nullable=false)
  134.      */
  135.     private $user;
  136.     /**
  137.      * @ORM\Column(type="datetime")
  138.      */
  139.     private $date_modification;
  140.     /**
  141.      * @ORM\OneToOne(targetEntity=QRCode::class, mappedBy="cuvee", cascade={"persist", "remove"})
  142.      */
  143.     private $qRCode;
  144.     /**
  145.      * @ORM\Column(type="string", length=255, nullable=true)
  146.      */
  147.     private $video;
  148.     /**
  149.      * @Vich\UploadableField(mapping = "videos", fileNameProperty = "video")
  150.      */
  151.     private $videoFile;
  152.     /**
  153.      * @ORM\Column(type="integer")
  154.      */
  155.     private $statut;
  156.     /**
  157.      * @ORM\ManyToOne(targetEntity=Appellation::class, inversedBy="cuvees")
  158.      */
  159.     private $appellation;
  160.     /**
  161.      * @ORM\OneToMany(targetEntity=CepageCuvee::class, mappedBy="cuvee", orphanRemoval=true, cascade={"persist", "remove"})
  162.      */
  163.     private $cepageCuvees;
  164.     /**
  165.      * @ORM\Column(type="text", nullable=true)
  166.      */
  167.     private $presentation;
  168.     /**
  169.      * @ORM\Column(type="string", length=255, nullable=true)
  170.      */
  171.     private $logo_QRCode;
  172.     /**
  173.      * @Vich\UploadableField(mapping = "produits", fileNameProperty = "logo_QRCode")
  174.      */
  175.     private $logo_QRCodeFile;
  176.     /**
  177.      * @ORM\Column(type="string", length=10, nullable=true)
  178.      */
  179.     private $color_QRCode;
  180.     public function __construct()
  181.     {
  182.         $this->labels = new ArrayCollection();
  183.         $this->cepageCuvees = new ArrayCollection();
  184.     }
  185.     
  186.     public function getId(): ?int
  187.     {
  188.         return $this->id;
  189.     }
  190.     public function getNomDomaine(): ?string
  191.     {
  192.         return $this->nom_domaine;
  193.     }
  194.     public function setNomDomaine(?string $nom_domaine): self
  195.     {
  196.         $this->nom_domaine $nom_domaine;
  197.         return $this;
  198.     }
  199.     public function getNomCuvee(): ?string
  200.     {
  201.         return $this->nom_cuvee;
  202.     }
  203.     public function setNomCuvee(?string $nom_cuvee): self
  204.     {
  205.         $this->nom_cuvee $nom_cuvee;
  206.         return $this;
  207.     }
  208.     public function getAnnee(): ?int
  209.     {
  210.         return $this->annee;
  211.     }
  212.     public function setAnnee(?int $annee): self
  213.     {
  214.         $this->annee $annee;
  215.         return $this;
  216.     }
  217.     public function getTypeBoisson(): ?Boisson
  218.     {
  219.         return $this->type_boisson;
  220.     }
  221.     public function setTypeBoisson(?Boisson $type_boisson): self
  222.     {
  223.         $this->type_boisson $type_boisson;
  224.         return $this;
  225.     }
  226.     public function getRegion(): ?Region
  227.     {
  228.         return $this->region;
  229.     }
  230.     public function setRegion(?Region $region): self
  231.     {
  232.         $this->region $region;
  233.         return $this;
  234.     }
  235.     public function getTeneurAlcool(): ?string
  236.     {
  237.         return $this->teneur_alcool;
  238.     }
  239.     public function setTeneurAlcool(?string $teneur_alcool): self
  240.     {
  241.         $this->teneur_alcool $teneur_alcool;
  242.         return $this;
  243.     }
  244.     public function isAllergenesSulfite(): ?bool
  245.     {
  246.         return $this->allergenes_sulfite;
  247.     }
  248.     public function setAllergenesSulfite(bool $allergenes_sulfite): self
  249.     {
  250.         $this->allergenes_sulfite $allergenes_sulfite;
  251.         return $this;
  252.     }
  253.     public function isAllergenesOeufs(): ?bool
  254.     {
  255.         return $this->allergenes_oeufs;
  256.     }
  257.     public function setAllergenesOeufs(bool $allergenes_oeufs): self
  258.     {
  259.         $this->allergenes_oeufs $allergenes_oeufs;
  260.         return $this;
  261.     }
  262.     public function isAllergenesLait(): ?bool
  263.     {
  264.         return $this->allergenes_lait;
  265.     }
  266.     public function setAllergenesLait(bool $allergenes_lait): self
  267.     {
  268.         $this->allergenes_lait $allergenes_lait;
  269.         return $this;
  270.     }
  271.     /**
  272.      * @return Collection<int, Label>
  273.      */
  274.     public function getLabels(): Collection
  275.     {
  276.         return $this->labels;
  277.     }
  278.     public function addLabel(Label $label): self
  279.     {
  280.         if (!$this->labels->contains($label)) {
  281.             $this->labels[] = $label;
  282.         }
  283.         return $this;
  284.     }
  285.     public function removeLabel(Label $label): self
  286.     {
  287.         $this->labels->removeElement($label);
  288.         return $this;
  289.     }
  290.     public function getNumeroLot(): ?string
  291.     {
  292.         return $this->numero_lot;
  293.     }
  294.     public function setNumeroLot(?string $numero_lot): self
  295.     {
  296.         $this->numero_lot $numero_lot;
  297.         return $this;
  298.     }
  299.     public function getContenance(): ?int
  300.     {
  301.         return $this->contenance;
  302.     }
  303.     public function setContenance(?int $contenance): self
  304.     {
  305.         $this->contenance $contenance;
  306.         return $this;
  307.     }
  308.     public function getIngredients(): ?string
  309.     {
  310.         return $this->ingredients;
  311.     }
  312.     public function setIngredients(?string $ingredients): self
  313.     {
  314.         $this->ingredients $ingredients;
  315.         return $this;
  316.     }
  317.     public function getEnergiesCalories(): ?int
  318.     {
  319.         return $this->energies_calories;
  320.     }
  321.     public function setEnergiesCalories(?int $energies_calories): self
  322.     {
  323.         $this->energies_calories $energies_calories;
  324.         return $this;
  325.     }
  326.     public function getEnergiesJoules(): ?int
  327.     {
  328.         return $this->energies_joules;
  329.     }
  330.     public function setEnergiesJoules(?int $energies_joules): self
  331.     {
  332.         $this->energies_joules $energies_joules;
  333.         return $this;
  334.     }
  335.     public function getLipides(): ?int
  336.     {
  337.         return $this->lipides;
  338.     }
  339.     public function setLipides(?int $lipides): self
  340.     {
  341.         $this->lipides $lipides;
  342.         return $this;
  343.     }
  344.     public function getAcideGras(): ?int
  345.     {
  346.         return $this->acide_gras;
  347.     }
  348.     public function setAcideGras(?int $acide_gras): self
  349.     {
  350.         $this->acide_gras $acide_gras;
  351.         return $this;
  352.     }
  353.     public function getProteines(): ?int
  354.     {
  355.         return $this->proteines;
  356.     }
  357.     public function setProteines(?int $proteines): self
  358.     {
  359.         $this->proteines $proteines;
  360.         return $this;
  361.     }
  362.     public function getGlucides(): ?int
  363.     {
  364.         return $this->glucides;
  365.     }
  366.     public function setGlucides(?int $glucides): self
  367.     {
  368.         $this->glucides $glucides;
  369.         return $this;
  370.     }
  371.     public function getSucres(): ?int
  372.     {
  373.         return $this->sucres;
  374.     }
  375.     public function setSucres(?int $sucres): self
  376.     {
  377.         $this->sucres $sucres;
  378.         return $this;
  379.     }
  380.     public function getSel(): ?int
  381.     {
  382.         return $this->sel;
  383.     }
  384.     public function setSel(?int $sel): self
  385.     {
  386.         $this->sel $sel;
  387.         return $this;
  388.     }
  389.     public function getPhoto(): ?string
  390.     {
  391.         return $this->photo;
  392.     }
  393.     public function setPhoto(?string $photo): self
  394.     {
  395.         $this->photo $photo;
  396.         return $this;
  397.     }
  398.     /**
  399.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  400.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  401.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  402.      * must be able to accept an instance of 'File' as the bundle will inject one here
  403.      * during Doctrine hydration.
  404.      *
  405.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  406.      */
  407.     public function setPhotoFile(?File $photoFile null): void
  408.     {
  409.         $this->photoFile $photoFile;
  410.         if (null !== $photoFile) {
  411.             // It is required that at least one field changes if you are using doctrine
  412.             // otherwise the event listeners won't be called and the file is lost
  413.             $this->date_modification = new \DateTimeImmutable();
  414.         }
  415.     }
  416.     public function getPhotoFile(): ?File
  417.     {
  418.         return $this->photoFile;
  419.     }
  420.     public function getEtiquette(): ?string
  421.     {
  422.         return $this->etiquette;
  423.     }
  424.     public function setEtiquette(?string $etiquette): self
  425.     {
  426.         $this->etiquette $etiquette;
  427.         return $this;
  428.     }
  429.     /**
  430.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  431.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  432.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  433.      * must be able to accept an instance of 'File' as the bundle will inject one here
  434.      * during Doctrine hydration.
  435.      *
  436.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  437.      */
  438.     public function setEtiquetteFile(?File $etiquetteFile null): void
  439.     {
  440.         $this->etiquetteFile $etiquetteFile;
  441.         if (null !== $etiquetteFile) {
  442.             // It is required that at least one field changes if you are using doctrine
  443.             // otherwise the event listeners won't be called and the file is lost
  444.             $this->date_modification = new \DateTimeImmutable();
  445.         }
  446.     }
  447.     public function getEtiquetteFile(): ?File
  448.     {
  449.         return $this->etiquetteFile;
  450.     }
  451.     public function getContreEtiquette(): ?string
  452.     {
  453.         return $this->contre_etiquette;
  454.     }
  455.     public function setContreEtiquette(?string $contre_etiquette): self
  456.     {
  457.         $this->contre_etiquette $contre_etiquette;
  458.         return $this;
  459.     }
  460.     /**
  461.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  462.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  463.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  464.      * must be able to accept an instance of 'File' as the bundle will inject one here
  465.      * during Doctrine hydration.
  466.      *
  467.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  468.      */
  469.     public function setContreEtiquetteFile(?File $contreEtiquetteFile null): void
  470.     {
  471.         $this->contre_etiquetteFile $contreEtiquetteFile;
  472.         if (null !== $contreEtiquetteFile) {
  473.             // It is required that at least one field changes if you are using doctrine
  474.             // otherwise the event listeners won't be called and the file is lost
  475.             $this->date_modification = new \DateTimeImmutable();
  476.         }
  477.     }
  478.     public function getContreEtiquetteFile(): ?File
  479.     {
  480.         return $this->contre_etiquetteFile;
  481.     }
  482.     public function getUser(): ?User
  483.     {
  484.         return $this->user;
  485.     }
  486.     public function setUser(?User $user): self
  487.     {
  488.         $this->user $user;
  489.         return $this;
  490.     }
  491.     public function getDateModification(): ?\DateTimeInterface
  492.     {
  493.         return $this->date_modification;
  494.     }
  495.     public function setDateModification(\DateTimeInterface $date_modification): self
  496.     {
  497.         $this->date_modification $date_modification;
  498.         return $this;
  499.     }
  500.     public function getQRCode(): ?QRCode
  501.     {
  502.         return $this->qRCode;
  503.     }
  504.     public function setQRCode(QRCode $qRCode): self
  505.     {
  506.         // set the owning side of the relation if necessary
  507.         if ($qRCode->getCuvee() !== $this) {
  508.             $qRCode->setCuvee($this);
  509.         }
  510.         $this->qRCode $qRCode;
  511.         return $this;
  512.     }
  513.     public function getVideo(): ?string
  514.     {
  515.         return $this->video;
  516.     }
  517.     public function setVideo(?string $video): self
  518.     {
  519.         $this->video $video;
  520.         return $this;
  521.     }
  522.     /**
  523.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  524.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  525.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  526.      * must be able to accept an instance of 'File' as the bundle will inject one here
  527.      * during Doctrine hydration.
  528.      *
  529.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  530.      */
  531.     public function setVideoFile(?File $videoFile null): void
  532.     {
  533.         $this->videoFile $videoFile;
  534.         if (null !== $videoFile) {
  535.             // It is required that at least one field changes if you are using doctrine
  536.             // otherwise the event listeners won't be called and the file is lost
  537.             $this->date_modification = new \DateTimeImmutable();
  538.         }
  539.     }
  540.     public function getVideoFile(): ?File
  541.     {
  542.         return $this->videoFile;
  543.     }
  544.     public function getStatut(): ?int
  545.     {
  546.         return $this->statut;
  547.     }
  548.     public function setStatut(int $statut): self
  549.     {
  550.         $this->statut $statut;
  551.         return $this;
  552.     }
  553.     public function getAppellation(): ?Appellation
  554.     {
  555.         return $this->appellation;
  556.     }
  557.     public function setAppellation(?Appellation $appellation): self
  558.     {
  559.         $this->appellation $appellation;
  560.         return $this;
  561.     }
  562.     /**
  563.      * @return Collection<int, CepageCuvee>
  564.      */
  565.     public function getCepageCuvees(): Collection
  566.     {
  567.         return $this->cepageCuvees;
  568.     }
  569.     public function addCepageCuvee(CepageCuvee $cepageCuvee): self
  570.     {
  571.         if (!$this->cepageCuvees->contains($cepageCuvee)) {
  572.             $this->cepageCuvees[] = $cepageCuvee;
  573.             $cepageCuvee->setCuvee($this);
  574.         }
  575.         return $this;
  576.     }
  577.     public function removeCepageCuvee(CepageCuvee $cepageCuvee): self
  578.     {
  579.         if ($this->cepageCuvees->removeElement($cepageCuvee)) {
  580.             // set the owning side to null (unless already changed)
  581.             if ($cepageCuvee->getCuvee() === $this) {
  582.                 $cepageCuvee->setCuvee(null);
  583.             }
  584.         }
  585.         return $this;
  586.     }
  587.     public function getPresentation(): ?string
  588.     {
  589.         return $this->presentation;
  590.     }
  591.     public function setPresentation(?string $presentation): self
  592.     {
  593.         $this->presentation $presentation;
  594.         return $this;
  595.     }
  596.     public function getLogoQRCode(): ?string
  597.     {
  598.         return $this->logo_QRCode;
  599.     }
  600.     public function setLogoQRCode(?string $logo_QRCode): self
  601.     {
  602.         $this->logo_QRCode $logo_QRCode;
  603.         return $this;
  604.     }
  605.     /**
  606.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  607.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  608.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  609.      * must be able to accept an instance of 'File' as the bundle will inject one here
  610.      * during Doctrine hydration.
  611.      *
  612.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  613.      */
  614.     public function setLogoQRCodeFile(?File $logo_QRCodeFile null): void
  615.     {
  616.         $this->logo_QRCodeFile $logo_QRCodeFile;
  617.         if (null !== $logo_QRCodeFile) {
  618.             // It is required that at least one field changes if you are using doctrine
  619.             // otherwise the event listeners won't be called and the file is lost
  620.             $this->date_modification = new \DateTimeImmutable();
  621.         }
  622.     }
  623.     public function getLogoQRCodeFile(): ?File
  624.     {
  625.         return $this->logo_QRCodeFile;
  626.     }
  627.     public function getColorQRCode(): ?string
  628.     {
  629.         return $this->color_QRCode;
  630.     }
  631.     public function setColorQRCode(?string $color_QRCode): self
  632.     {
  633.         $this->color_QRCode $color_QRCode;
  634.         return $this;
  635.     }
  636. }