<?php
namespace App\Entity;
use App\Repository\CuveeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=CuveeRepository::class)
* @Vich\Uploadable
*/
class Cuvee
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nom_domaine;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nom_cuvee;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $annee;
/**
* @ORM\ManyToOne(targetEntity=Boisson::class, inversedBy="cuvees")
* @ORM\JoinColumn(nullable=true)
*/
private $type_boisson;
/**
* @ORM\ManyToOne(targetEntity=Region::class, inversedBy="cuvees")
* @ORM\JoinColumn(nullable=true)
*/
private $region;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $teneur_alcool;
/**
* @ORM\Column(type="boolean")
*/
private $allergenes_sulfite;
/**
* @ORM\Column(type="boolean")
*/
private $allergenes_oeufs;
/**
* @ORM\Column(type="boolean")
*/
private $allergenes_lait;
/**
* @ORM\ManyToMany(targetEntity=Label::class, inversedBy="cuvees")
*/
private $labels;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $numero_lot;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $contenance;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $ingredients;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $energies_calories;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $energies_joules;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $lipides;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $acide_gras;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $proteines;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $glucides;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $sucres;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $sel;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $photo;
/**
* @Vich\UploadableField(mapping = "produits", fileNameProperty = "photo")
*/
private $photoFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $etiquette;
/**
* @Vich\UploadableField(mapping = "produits", fileNameProperty = "etiquette")
*/
private $etiquetteFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $contre_etiquette;
/**
* @Vich\UploadableField(mapping = "produits", fileNameProperty = "contre_etiquette")
*/
private $contre_etiquetteFile;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="cuvees")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="datetime")
*/
private $date_modification;
/**
* @ORM\OneToOne(targetEntity=QRCode::class, mappedBy="cuvee", cascade={"persist", "remove"})
*/
private $qRCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $video;
/**
* @Vich\UploadableField(mapping = "videos", fileNameProperty = "video")
*/
private $videoFile;
/**
* @ORM\Column(type="integer")
*/
private $statut;
/**
* @ORM\ManyToOne(targetEntity=Appellation::class, inversedBy="cuvees")
*/
private $appellation;
/**
* @ORM\OneToMany(targetEntity=CepageCuvee::class, mappedBy="cuvee", orphanRemoval=true, cascade={"persist", "remove"})
*/
private $cepageCuvees;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $presentation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $logo_QRCode;
/**
* @Vich\UploadableField(mapping = "produits", fileNameProperty = "logo_QRCode")
*/
private $logo_QRCodeFile;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $color_QRCode;
public function __construct()
{
$this->labels = new ArrayCollection();
$this->cepageCuvees = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNomDomaine(): ?string
{
return $this->nom_domaine;
}
public function setNomDomaine(?string $nom_domaine): self
{
$this->nom_domaine = $nom_domaine;
return $this;
}
public function getNomCuvee(): ?string
{
return $this->nom_cuvee;
}
public function setNomCuvee(?string $nom_cuvee): self
{
$this->nom_cuvee = $nom_cuvee;
return $this;
}
public function getAnnee(): ?int
{
return $this->annee;
}
public function setAnnee(?int $annee): self
{
$this->annee = $annee;
return $this;
}
public function getTypeBoisson(): ?Boisson
{
return $this->type_boisson;
}
public function setTypeBoisson(?Boisson $type_boisson): self
{
$this->type_boisson = $type_boisson;
return $this;
}
public function getRegion(): ?Region
{
return $this->region;
}
public function setRegion(?Region $region): self
{
$this->region = $region;
return $this;
}
public function getTeneurAlcool(): ?string
{
return $this->teneur_alcool;
}
public function setTeneurAlcool(?string $teneur_alcool): self
{
$this->teneur_alcool = $teneur_alcool;
return $this;
}
public function isAllergenesSulfite(): ?bool
{
return $this->allergenes_sulfite;
}
public function setAllergenesSulfite(bool $allergenes_sulfite): self
{
$this->allergenes_sulfite = $allergenes_sulfite;
return $this;
}
public function isAllergenesOeufs(): ?bool
{
return $this->allergenes_oeufs;
}
public function setAllergenesOeufs(bool $allergenes_oeufs): self
{
$this->allergenes_oeufs = $allergenes_oeufs;
return $this;
}
public function isAllergenesLait(): ?bool
{
return $this->allergenes_lait;
}
public function setAllergenesLait(bool $allergenes_lait): self
{
$this->allergenes_lait = $allergenes_lait;
return $this;
}
/**
* @return Collection<int, Label>
*/
public function getLabels(): Collection
{
return $this->labels;
}
public function addLabel(Label $label): self
{
if (!$this->labels->contains($label)) {
$this->labels[] = $label;
}
return $this;
}
public function removeLabel(Label $label): self
{
$this->labels->removeElement($label);
return $this;
}
public function getNumeroLot(): ?string
{
return $this->numero_lot;
}
public function setNumeroLot(?string $numero_lot): self
{
$this->numero_lot = $numero_lot;
return $this;
}
public function getContenance(): ?int
{
return $this->contenance;
}
public function setContenance(?int $contenance): self
{
$this->contenance = $contenance;
return $this;
}
public function getIngredients(): ?string
{
return $this->ingredients;
}
public function setIngredients(?string $ingredients): self
{
$this->ingredients = $ingredients;
return $this;
}
public function getEnergiesCalories(): ?int
{
return $this->energies_calories;
}
public function setEnergiesCalories(?int $energies_calories): self
{
$this->energies_calories = $energies_calories;
return $this;
}
public function getEnergiesJoules(): ?int
{
return $this->energies_joules;
}
public function setEnergiesJoules(?int $energies_joules): self
{
$this->energies_joules = $energies_joules;
return $this;
}
public function getLipides(): ?int
{
return $this->lipides;
}
public function setLipides(?int $lipides): self
{
$this->lipides = $lipides;
return $this;
}
public function getAcideGras(): ?int
{
return $this->acide_gras;
}
public function setAcideGras(?int $acide_gras): self
{
$this->acide_gras = $acide_gras;
return $this;
}
public function getProteines(): ?int
{
return $this->proteines;
}
public function setProteines(?int $proteines): self
{
$this->proteines = $proteines;
return $this;
}
public function getGlucides(): ?int
{
return $this->glucides;
}
public function setGlucides(?int $glucides): self
{
$this->glucides = $glucides;
return $this;
}
public function getSucres(): ?int
{
return $this->sucres;
}
public function setSucres(?int $sucres): self
{
$this->sucres = $sucres;
return $this;
}
public function getSel(): ?int
{
return $this->sel;
}
public function setSel(?int $sel): self
{
$this->sel = $sel;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setPhotoFile(?File $photoFile = null): void
{
$this->photoFile = $photoFile;
if (null !== $photoFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->date_modification = new \DateTimeImmutable();
}
}
public function getPhotoFile(): ?File
{
return $this->photoFile;
}
public function getEtiquette(): ?string
{
return $this->etiquette;
}
public function setEtiquette(?string $etiquette): self
{
$this->etiquette = $etiquette;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setEtiquetteFile(?File $etiquetteFile = null): void
{
$this->etiquetteFile = $etiquetteFile;
if (null !== $etiquetteFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->date_modification = new \DateTimeImmutable();
}
}
public function getEtiquetteFile(): ?File
{
return $this->etiquetteFile;
}
public function getContreEtiquette(): ?string
{
return $this->contre_etiquette;
}
public function setContreEtiquette(?string $contre_etiquette): self
{
$this->contre_etiquette = $contre_etiquette;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setContreEtiquetteFile(?File $contreEtiquetteFile = null): void
{
$this->contre_etiquetteFile = $contreEtiquetteFile;
if (null !== $contreEtiquetteFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->date_modification = new \DateTimeImmutable();
}
}
public function getContreEtiquetteFile(): ?File
{
return $this->contre_etiquetteFile;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getDateModification(): ?\DateTimeInterface
{
return $this->date_modification;
}
public function setDateModification(\DateTimeInterface $date_modification): self
{
$this->date_modification = $date_modification;
return $this;
}
public function getQRCode(): ?QRCode
{
return $this->qRCode;
}
public function setQRCode(QRCode $qRCode): self
{
// set the owning side of the relation if necessary
if ($qRCode->getCuvee() !== $this) {
$qRCode->setCuvee($this);
}
$this->qRCode = $qRCode;
return $this;
}
public function getVideo(): ?string
{
return $this->video;
}
public function setVideo(?string $video): self
{
$this->video = $video;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setVideoFile(?File $videoFile = null): void
{
$this->videoFile = $videoFile;
if (null !== $videoFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->date_modification = new \DateTimeImmutable();
}
}
public function getVideoFile(): ?File
{
return $this->videoFile;
}
public function getStatut(): ?int
{
return $this->statut;
}
public function setStatut(int $statut): self
{
$this->statut = $statut;
return $this;
}
public function getAppellation(): ?Appellation
{
return $this->appellation;
}
public function setAppellation(?Appellation $appellation): self
{
$this->appellation = $appellation;
return $this;
}
/**
* @return Collection<int, CepageCuvee>
*/
public function getCepageCuvees(): Collection
{
return $this->cepageCuvees;
}
public function addCepageCuvee(CepageCuvee $cepageCuvee): self
{
if (!$this->cepageCuvees->contains($cepageCuvee)) {
$this->cepageCuvees[] = $cepageCuvee;
$cepageCuvee->setCuvee($this);
}
return $this;
}
public function removeCepageCuvee(CepageCuvee $cepageCuvee): self
{
if ($this->cepageCuvees->removeElement($cepageCuvee)) {
// set the owning side to null (unless already changed)
if ($cepageCuvee->getCuvee() === $this) {
$cepageCuvee->setCuvee(null);
}
}
return $this;
}
public function getPresentation(): ?string
{
return $this->presentation;
}
public function setPresentation(?string $presentation): self
{
$this->presentation = $presentation;
return $this;
}
public function getLogoQRCode(): ?string
{
return $this->logo_QRCode;
}
public function setLogoQRCode(?string $logo_QRCode): self
{
$this->logo_QRCode = $logo_QRCode;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setLogoQRCodeFile(?File $logo_QRCodeFile = null): void
{
$this->logo_QRCodeFile = $logo_QRCodeFile;
if (null !== $logo_QRCodeFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->date_modification = new \DateTimeImmutable();
}
}
public function getLogoQRCodeFile(): ?File
{
return $this->logo_QRCodeFile;
}
public function getColorQRCode(): ?string
{
return $this->color_QRCode;
}
public function setColorQRCode(?string $color_QRCode): self
{
$this->color_QRCode = $color_QRCode;
return $this;
}
}