src/Entity/Commande.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\CommandeRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassCommandeRepository::class)]
  10. #[ApiResource]
  11. class Commande
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne(inversedBy'commandes')]
  18.     private ?User $user null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  20.     private ?\DateTimeInterface $date null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $soustotal null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $tva null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $total null;
  27.     #[ORM\Column(nullabletrue)]
  28.     private ?bool $isPayer null;
  29.     #[ORM\OneToMany(mappedBy'commande'targetEntityCommandeFormation::class ,cascade: ['remove'])]
  30.     private Collection $commandeFormations;
  31.     #[ORM\Column(nullabletrue)]
  32.     private ?bool $isVu null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $statut null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $facture null;
  37.     #[ORM\OneToMany(mappedBy'commande'targetEntityFacture::class,cascade: ['remove'])]
  38.     private Collection $factures;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $commande null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $numfact null;
  43.     public function __construct()
  44.     {
  45.         $this->commandeFormations = new ArrayCollection();
  46.         $this->factures = new ArrayCollection();
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getUser(): ?User
  53.     {
  54.         return $this->user;
  55.     }
  56.     public function setUser(?User $user): self
  57.     {
  58.         $this->user $user;
  59.         return $this;
  60.     }
  61.     public function getDate(): ?\DateTimeInterface
  62.     {
  63.         return $this->date;
  64.     }
  65.     public function setDate(?\DateTimeInterface $date): self
  66.     {
  67.         $this->date $date;
  68.         return $this;
  69.     }
  70.     public function getSoustotal(): ?string
  71.     {
  72.         return $this->soustotal;
  73.     }
  74.     public function setSoustotal(?string $soustotal): self
  75.     {
  76.         $this->soustotal $soustotal;
  77.         return $this;
  78.     }
  79.     public function getTva(): ?string
  80.     {
  81.         return $this->tva;
  82.     }
  83.     public function setTva(?string $tva): self
  84.     {
  85.         $this->tva $tva;
  86.         return $this;
  87.     }
  88.     public function getTotal(): ?string
  89.     {
  90.         return $this->total;
  91.     }
  92.     public function setTotal(?string $total): self
  93.     {
  94.         $this->total $total;
  95.         return $this;
  96.     }
  97.     public function isIsPayer(): ?bool
  98.     {
  99.         return $this->isPayer;
  100.     }
  101.     public function setIsPayer(?bool $isPayer): self
  102.     {
  103.         $this->isPayer $isPayer;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection<int, CommandeFormation>
  108.      */
  109.     public function getCommandeFormations(): Collection
  110.     {
  111.         return $this->commandeFormations;
  112.     }
  113.     public function addCommandeFormation(CommandeFormation $commandeFormation): self
  114.     {
  115.         if (!$this->commandeFormations->contains($commandeFormation)) {
  116.             $this->commandeFormations->add($commandeFormation);
  117.             $commandeFormation->setCommande($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeCommandeFormation(CommandeFormation $commandeFormation): self
  122.     {
  123.         if ($this->commandeFormations->removeElement($commandeFormation)) {
  124.             // set the owning side to null (unless already changed)
  125.             if ($commandeFormation->getCommande() === $this) {
  126.                 $commandeFormation->setCommande(null);
  127.             }
  128.         }
  129.         return $this;
  130.     }
  131.     public function isIsVu(): ?bool
  132.     {
  133.         return $this->isVu;
  134.     }
  135.     public function setIsVu(?bool $isVu): self
  136.     {
  137.         $this->isVu $isVu;
  138.         return $this;
  139.     }
  140.     public function getStatut(): ?string
  141.     {
  142.         return $this->statut;
  143.     }
  144.     public function setStatut(?string $statut): self
  145.     {
  146.         $this->statut $statut;
  147.         return $this;
  148.     }
  149.     public function getFacture(): ?string
  150.     {
  151.         return $this->facture;
  152.     }
  153.     public function setFacture(?string $facture): self
  154.     {
  155.         $this->facture $facture;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, Facture>
  160.      */
  161.     public function getFactures(): Collection
  162.     {
  163.         return $this->factures;
  164.     }
  165.     public function addFacture(Facture $facture): self
  166.     {
  167.         if (!$this->factures->contains($facture)) {
  168.             $this->factures->add($facture);
  169.             $facture->setCommande($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeFacture(Facture $facture): self
  174.     {
  175.         if ($this->factures->removeElement($facture)) {
  176.             // set the owning side to null (unless already changed)
  177.             if ($facture->getCommande() === $this) {
  178.                 $facture->setCommande(null);
  179.             }
  180.         }
  181.         return $this;
  182.     }
  183.     public function getCommande(): ?string
  184.     {
  185.         return $this->commande;
  186.     }
  187.     public function setCommande(?string $commande): self
  188.     {
  189.         $this->commande $commande;
  190.         return $this;
  191.     }
  192.     public function getNumfact(): ?string
  193.     {
  194.         return $this->numfact;
  195.     }
  196.     public function setNumfact(?string $numfact): self
  197.     {
  198.         $this->numfact $numfact;
  199.         return $this;
  200.     }
  201. }