src/Entity/TrGrosseCommande.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Contract\ManagedOrderInterface;
  4. use App\Repository\TrGrosseCommandeRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=TrGrosseCommandeRepository::class)
  8.  */
  9. class TrGrosseCommande implements ManagedOrderInterface
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=TrProduits::class, inversedBy="trGrosseCommandes")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $PRODUIT;
  22.     /**
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $NOMBRE;
  26.     /**
  27.      * @ORM\Column(type="date")
  28.      */
  29.     private $DATELIVRAISON;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $TELEPHONE;
  34.     /**
  35.      * @ORM\Column(name="statut_commande", type="string", length=30, options={"default"="en_attente"})
  36.      */
  37.     private $statut_commande = 'en_attente';
  38.     /**
  39.      * @ORM\Column(name="motif_annulation", type="text", nullable=true)
  40.      */
  41.     private $motif_annulation;
  42.     /**
  43.      * @ORM\Column(name="date_annulation", type="datetime", nullable=true)
  44.      */
  45.     private $date_annulation;
  46.     /**
  47.      * @ORM\Column(name="date_livree_at", type="datetime", nullable=true)
  48.      */
  49.     private $date_livree_at;
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getPRODUIT(): ?TrProduits
  55.     {
  56.         return $this->PRODUIT;
  57.     }
  58.     public function setPRODUIT(?TrProduits $PRODUIT): self
  59.     {
  60.         $this->PRODUIT = $PRODUIT;
  61.         return $this;
  62.     }
  63.     public function getNOMBRE(): ?int
  64.     {
  65.         return $this->NOMBRE;
  66.     }
  67.     public function setNOMBRE(int $NOMBRE): self
  68.     {
  69.         $this->NOMBRE = $NOMBRE;
  70.         return $this;
  71.     }
  72.     public function getDATELIVRAISON(): ?\DateTimeInterface
  73.     {
  74.         return $this->DATELIVRAISON;
  75.     }
  76.     public function setDATELIVRAISON(\DateTimeInterface $DATELIVRAISON): self
  77.     {
  78.         $this->DATELIVRAISON = $DATELIVRAISON;
  79.         return $this;
  80.     }
  81.     public function getTELEPHONE(): ?string
  82.     {
  83.         return $this->TELEPHONE;
  84.     }
  85.     public function setTELEPHONE(string $TELEPHONE): self
  86.     {
  87.         $this->TELEPHONE = $TELEPHONE;
  88.         return $this;
  89.     }
  90.     public function getReferenceCommande(): ?string
  91.     {
  92.         $year = $this->DATELIVRAISON instanceof \DateTimeInterface
  93.             ? $this->DATELIVRAISON->format('Y')
  94.             : (new \DateTimeImmutable())->format('Y');
  95.         return sprintf('CG-%s-%05d', $year, (int) $this->id);
  96.     }
  97.     public function getTelephoneCommande(): ?string
  98.     {
  99.         return $this->getTELEPHONE();
  100.     }
  101.     public function getStatutCommande(): ?string
  102.     {
  103.         return $this->statut_commande;
  104.     }
  105.     public function setStatutCommande(?string $statut_commande): self
  106.     {
  107.         $this->statut_commande = $statut_commande;
  108.         return $this;
  109.     }
  110.     public function getPlannedDeliveryDate(): ?\DateTimeInterface
  111.     {
  112.         return $this->getDATELIVRAISON();
  113.     }
  114.     public function setPlannedDeliveryDate(?\DateTimeInterface $date_livraison): self
  115.     {
  116.         if (null !== $date_livraison) {
  117.             $this->setDATELIVRAISON($date_livraison);
  118.         }
  119.         return $this;
  120.     }
  121.     public function getMotifAnnulation(): ?string
  122.     {
  123.         return $this->motif_annulation;
  124.     }
  125.     public function setMotifAnnulation(?string $motif_annulation): self
  126.     {
  127.         $this->motif_annulation = $motif_annulation;
  128.         return $this;
  129.     }
  130.     public function getDateAnnulation(): ?\DateTimeInterface
  131.     {
  132.         return $this->date_annulation;
  133.     }
  134.     public function setDateAnnulation(?\DateTimeInterface $date_annulation): self
  135.     {
  136.         $this->date_annulation = $date_annulation;
  137.         return $this;
  138.     }
  139.     public function getDateLivreeAt(): ?\DateTimeInterface
  140.     {
  141.         return $this->date_livree_at;
  142.     }
  143.     public function setDateLivreeAt(?\DateTimeInterface $date_livree_at): self
  144.     {
  145.         $this->date_livree_at = $date_livree_at;
  146.         return $this;
  147.     }
  148. }