FestinHegre/src/Entity/Plats.php

163 lines
3.1 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\PlatsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PlatsRepository::class)]
class Plats
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Nom = null;
#[ORM\Column(length: 255)]
private ?string $Description = null;
#[ORM\Column]
private ?float $Prix = null;
#[ORM\Column(length: 255)]
private ?string $Categorie = null;
#[ORM\Column]
private ?bool $Statut = null;
#[ORM\Column]
private ?int $Nb_de_commande = null;
/**
* @var Collection<int, Commandes>
*/
#[ORM\ManyToMany(targetEntity: Commandes::class, inversedBy: 'plats')]
private Collection $Commande;
#[ORM\ManyToOne(inversedBy: 'plats')]
private ?Reductions $Reduction = null;
public function __construct()
{
$this->Commande = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->Nom;
}
public function setNom(string $Nom): static
{
$this->Nom = $Nom;
return $this;
}
public function getDescription(): ?string
{
return $this->Description;
}
public function setDescription(string $Description): static
{
$this->Description = $Description;
return $this;
}
public function getPrix(): ?float
{
return $this->Prix;
}
public function setPrix(float $Prix): static
{
$this->Prix = $Prix;
return $this;
}
public function getCategorie(): ?string
{
return $this->Categorie;
}
public function setCategorie(string $Categorie): static
{
$this->Categorie = $Categorie;
return $this;
}
public function isStatut(): ?bool
{
return $this->Statut;
}
public function setStatut(bool $Statut): static
{
$this->Statut = $Statut;
return $this;
}
public function getNbDeCommande(): ?int
{
return $this->Nb_de_commande;
}
public function setNbDeCommande(int $Nb_de_commande): static
{
$this->Nb_de_commande = $Nb_de_commande;
return $this;
}
/**
* @return Collection<int, Commandes>
*/
public function getCommande(): Collection
{
return $this->Commande;
}
public function addCommande(Commandes $commande): static
{
if (!$this->Commande->contains($commande)) {
$this->Commande->add($commande);
}
return $this;
}
public function removeCommande(Commandes $commande): static
{
$this->Commande->removeElement($commande);
return $this;
}
public function getReduction(): ?Reductions
{
return $this->Reduction;
}
public function setReduction(?Reductions $Reduction): static
{
$this->Reduction = $Reduction;
return $this;
}
}