<?php
namespace App\Entity;
use App\Repository\CommandesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CommandesRepository::class)
*/
class Commandes
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $Created;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="commandes")
*/
private $User;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $Quantite;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $Total;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $Paye;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $UniqId;
/**
* @ORM\OneToMany(targetEntity=Factures::class, mappedBy="Commandes")
*/
private $factures;
public function __construct()
{
$this->factures = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->Created;
}
public function setCreated(?\DateTimeInterface $Created): self
{
$this->Created = $Created;
return $this;
}
public function getUser(): ?User
{
return $this->User;
}
public function setUser(?User $User): self
{
$this->User = $User;
return $this;
}
public function getQuantite(): ?int
{
return $this->Quantite;
}
public function setQuantite(?int $Quantite): self
{
$this->Quantite = $Quantite;
return $this;
}
public function getTotal(): ?float
{
return $this->Total;
}
public function setTotal(?float $Total): self
{
$this->Total = $Total;
return $this;
}
public function isPaye(): ?bool
{
return $this->Paye;
}
public function setPaye(?bool $Paye): self
{
$this->Paye = $Paye;
return $this;
}
public function getUniqId(): ?string
{
return $this->UniqId;
}
public function setUniqId(?string $UniqId): self
{
$this->UniqId = $UniqId;
return $this;
}
/**
* @return Collection<int, Factures>
*/
public function getFactures(): Collection
{
return $this->factures;
}
public function addFacture(Factures $facture): self
{
if (!$this->factures->contains($facture)) {
$this->factures[] = $facture;
$facture->setCommandes($this);
}
return $this;
}
public function removeFacture(Factures $facture): self
{
if ($this->factures->removeElement($facture)) {
// set the owning side to null (unless already changed)
if ($facture->getCommandes() === $this) {
$facture->setCommandes(null);
}
}
return $this;
}
}