155 lines
3.2 KiB
PHP
155 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\ReductionsRepository;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: ReductionsRepository::class)]
|
|
class Reductions
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $Description = null;
|
|
|
|
#[ORM\Column]
|
|
private ?float $Prix = null;
|
|
|
|
#[ORM\Column]
|
|
private ?int $Pourcentage = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $MontantFixe = null;
|
|
|
|
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
|
private ?\DateTimeInterface $DateDebut = null;
|
|
|
|
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
|
private ?\DateTimeInterface $DateFin = null;
|
|
|
|
/**
|
|
* @var Collection<int, Plats>
|
|
*/
|
|
#[ORM\OneToMany(targetEntity: Plats::class, mappedBy: 'Reduction')]
|
|
private Collection $plats;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->plats = new ArrayCollection();
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
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 getPourcentage(): ?int
|
|
{
|
|
return $this->Pourcentage;
|
|
}
|
|
|
|
public function setPourcentage(int $Pourcentage): static
|
|
{
|
|
$this->Pourcentage = $Pourcentage;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getMontantFixe(): ?string
|
|
{
|
|
return $this->MontantFixe;
|
|
}
|
|
|
|
public function setMontantFixe(string $MontantFixe): static
|
|
{
|
|
$this->MontantFixe = $MontantFixe;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDateDebut(): ?\DateTimeInterface
|
|
{
|
|
return $this->DateDebut;
|
|
}
|
|
|
|
public function setDateDebut(\DateTimeInterface $DateDebut): static
|
|
{
|
|
$this->DateDebut = $DateDebut;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDateFin(): ?\DateTimeInterface
|
|
{
|
|
return $this->DateFin;
|
|
}
|
|
|
|
public function setDateFin(\DateTimeInterface $DateFin): static
|
|
{
|
|
$this->DateFin = $DateFin;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection<int, Plats>
|
|
*/
|
|
public function getPlats(): Collection
|
|
{
|
|
return $this->plats;
|
|
}
|
|
|
|
public function addPlat(Plats $plat): static
|
|
{
|
|
if (!$this->plats->contains($plat)) {
|
|
$this->plats->add($plat);
|
|
$plat->setReduction($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removePlat(Plats $plat): static
|
|
{
|
|
if ($this->plats->removeElement($plat)) {
|
|
// set the owning side to null (unless already changed)
|
|
if ($plat->getReduction() === $this) {
|
|
$plat->setReduction(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
}
|