src/Entity/Commandes.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommandesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CommandesRepository::class)
  9.  */
  10. class Commandes
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime", nullable=true)
  20.      */
  21.     private $Created;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="commandes")
  24.      */
  25.     private $User;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true)
  28.      */
  29.     private $Quantite;
  30.     /**
  31.      * @ORM\Column(type="float", nullable=true)
  32.      */
  33.     private $Total;
  34.     /**
  35.      * @ORM\Column(type="boolean", nullable=true)
  36.      */
  37.     private $Paye;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $UniqId;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=Factures::class, mappedBy="Commandes")
  44.      */
  45.     private $factures;
  46.     public function __construct()
  47.     {
  48.         $this->factures = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getCreated(): ?\DateTimeInterface
  55.     {
  56.         return $this->Created;
  57.     }
  58.     public function setCreated(?\DateTimeInterface $Created): self
  59.     {
  60.         $this->Created $Created;
  61.         return $this;
  62.     }
  63.     public function getUser(): ?User
  64.     {
  65.         return $this->User;
  66.     }
  67.     public function setUser(?User $User): self
  68.     {
  69.         $this->User $User;
  70.         return $this;
  71.     }
  72.     public function getQuantite(): ?int
  73.     {
  74.         return $this->Quantite;
  75.     }
  76.     public function setQuantite(?int $Quantite): self
  77.     {
  78.         $this->Quantite $Quantite;
  79.         return $this;
  80.     }
  81.     public function getTotal(): ?float
  82.     {
  83.         return $this->Total;
  84.     }
  85.     public function setTotal(?float $Total): self
  86.     {
  87.         $this->Total $Total;
  88.         return $this;
  89.     }
  90.     public function isPaye(): ?bool
  91.     {
  92.         return $this->Paye;
  93.     }
  94.     public function setPaye(?bool $Paye): self
  95.     {
  96.         $this->Paye $Paye;
  97.         return $this;
  98.     }
  99.     public function getUniqId(): ?string
  100.     {
  101.         return $this->UniqId;
  102.     }
  103.     public function setUniqId(?string $UniqId): self
  104.     {
  105.         $this->UniqId $UniqId;
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, Factures>
  110.      */
  111.     public function getFactures(): Collection
  112.     {
  113.         return $this->factures;
  114.     }
  115.     public function addFacture(Factures $facture): self
  116.     {
  117.         if (!$this->factures->contains($facture)) {
  118.             $this->factures[] = $facture;
  119.             $facture->setCommandes($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeFacture(Factures $facture): self
  124.     {
  125.         if ($this->factures->removeElement($facture)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($facture->getCommandes() === $this) {
  128.                 $facture->setCommandes(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133. }