src\Entity\Commande.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommandeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity(repositoryClass: CommandeRepository::class)]
  7. #[ORM\Table(name: '`commande`')]
  8. #[UniqueEntity(fields: ['numero_commande'], message: 'Le numéro de commande existe déjà')]
  9. class Commande
  10. {
  11. #[ORM\Id]
  12. #[ORM\Column(type:"string",length: 50, unique: true, nullable: false)]
  13. private ?string $numero_commande = null;
  14. #[ORM\Column(type:"date", nullable: false)]
  15. private ?\DateTime $date_commande = null;
  16. #[ORM\Column(type:"date", nullable: true)]
  17. private ?\DateTime $date_prestation = null;
  18. #[ORM\ManyToOne(targetEntity: Utilisateur::class)]
  19. #[ORM\JoinColumn(name: "utilisateur_id", referencedColumnName: "utilisateur_id", onDelete: "CASCADE")]
  20. private ?Utilisateur $utilisateur_id = null;
  21. #[ORM\ManyToOne(targetEntity: Menu::class)]
  22. #[ORM\JoinColumn(name: "menu_id", referencedColumnName: "menu_id", onDelete: "CASCADE")]
  23. private ?Menu $menu_id = null;
  24. #[ORM\Column(type:"string",length: 50,nullable: false)]
  25. private ?string $heure_livraison = null;
  26. #[ORM\Column(type:"float",nullable: false)]
  27. private ?float $prix_menu = null;
  28. #[ORM\Column(type:"integer", nullable: false)]
  29. private ?int $nombre_personne = null;
  30. #[ORM\Column(type:"float", nullable: false)]
  31. private ?float $prix_livraison = null;
  32. #[ORM\Column(type:"string",length: 50, nullable: false)]
  33. private ?string $statut = null;
  34. #[ORM\Column(type:"boolean", nullable: false)]
  35. private ?bool $pret_materiel = null;
  36. #[ORM\Column(type:"boolean",nullable: false)]
  37. private ?bool $restitution_materiel = null;
  38. public function getNumeroCommande(): ?string
  39. {
  40. return $this->numero_commande;
  41. }
  42. public function setNumeroCommande(string $numero_commande): static
  43. {
  44. $this->numero_commande = $numero_commande;
  45. return $this;
  46. }
  47. public function getDateCommande(): ?\DateTime
  48. {
  49. return $this->date_commande;
  50. }
  51. public function setDateCommande(\DateTime $date_commande): static
  52. {
  53. $this->date_commande = $date_commande;
  54. return $this;
  55. }
  56. public function getDatePrestation(): ?\DateTime
  57. {
  58. return $this->date_prestation;
  59. }
  60. public function setDatePrestation(?\DateTime $date_prestation): static
  61. {
  62. $this->date_prestation = $date_prestation;
  63. return $this;
  64. }
  65. public function getUtilisateurId(): ?Utilisateur
  66. {
  67. return $this->utilisateur_id;
  68. }
  69. public function setUtilisateurId(?Utilisateur $utilisateur_id): static
  70. {
  71. $this->utilisateur_id = $utilisateur_id;
  72. return $this;
  73. }
  74. public function getMenuId(): ?Menu
  75. {
  76. return $this->menu_id;
  77. }
  78. public function setMenuId(?Menu $menu_id): static
  79. {
  80. $this->menu_id = $menu_id;
  81. return $this;
  82. }
  83. public function getHeureLivraison(): ?string
  84. {
  85. return $this->heure_livraison;
  86. }
  87. public function setHeureLivraison(string $heure_livraison): static
  88. {
  89. $this->heure_livraison = $heure_livraison;
  90. return $this;
  91. }
  92. public function getPrixMenu(): ?float
  93. {
  94. return $this->prix_menu;
  95. }
  96. public function setPrixMenu(float $prix_menu): static
  97. {
  98. $this->prix_menu = $prix_menu;
  99. return $this;
  100. }
  101. public function getNombrePersonne(): ?float
  102. {
  103. return $this->nombre_personne;
  104. }
  105. public function setNombrePersonne(float $nombre_personne): static
  106. {
  107. $this->nombre_personne = $nombre_personne;
  108. return $this;
  109. }
  110. public function getPrixLivraison(): ?float
  111. {
  112. return $this->prix_livraison;
  113. }
  114. public function setPrixLivraison(float $prix_livraison): static
  115. {
  116. $this->prix_livraison = $prix_livraison;
  117. return $this;
  118. }
  119. public function getStatut(): ?string
  120. {
  121. return $this->statut;
  122. }
  123. public function setStatut(string $statut): static
  124. {
  125. $this->statut = $statut;
  126. return $this;
  127. }
  128. public function isPretMateriel(): ?bool
  129. {
  130. return $this->pret_materiel;
  131. }
  132. public function setPretMateriel(bool $pret_materiel): static
  133. {
  134. $this->pret_materiel = $pret_materiel;
  135. return $this;
  136. }
  137. public function isRestitutionMateriel(): ?bool
  138. {
  139. return $this->restitution_materiel;
  140. }
  141. public function setRestitutionMateriel(bool $restitution_materiel): static
  142. {
  143. $this->restitution_materiel = $restitution_materiel;
  144. return $this;
  145. }
  146. }