src/Entity/Livraisons.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\LivraisonsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: LivraisonsRepository::class)]
  8. #[ApiResource]
  9. class Livraisons
  10. {
  11. #[ORM\Id]
  12. #[ORM\GeneratedValue]
  13. #[ORM\Column]
  14. #[ORM\OrderBy(["id" => "DESC"])]
  15. private ?int $id = null;
  16. #[ORM\Column(length: 255)]
  17. private ?float $distance = 0.0;
  18. #[ORM\Column(length: 255)]
  19. private ?string $latitude = null;
  20. #[ORM\Column(length: 255)]
  21. private ?string $longitude = null;
  22. #[ORM\Column(length: 255)]
  23. private ?string $pays = null;
  24. #[ORM\Column(length: 255)]
  25. private ?string $adresse_depart = null;
  26. #[ORM\Column(length: 255)]
  27. private ?string $adresse_arrivee = null;
  28. #[ORM\Column]
  29. private ?int $creditslivraisons = 3;
  30. #[ORM\Column(length: 355, nullable: true)]
  31. private ?string $description = null;
  32. #[Assert\Positive(message: "La valeur doit être un nombre positif.")]
  33. #[ORM\Column]
  34. private ?int $poids = null;
  35. #[ORM\ManyToOne(targetEntity: Livreurs::class, inversedBy: 'livraisons')]
  36. #[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
  37. private ?Livreurs $id_livreurs = null;
  38. #[ORM\ManyToOne(inversedBy: 'livraisons')]
  39. private ?TypeLivraison $type_livraison = null;
  40. #[ORM\ManyToOne(inversedBy: 'livraisons')]
  41. private ?StatutLivraison $statut_livraison = null;
  42. #[ORM\Column(length: 255)]
  43. private ?string $userprofile = null;
  44. #[ORM\ManyToOne(inversedBy: 'livraisons')]
  45. private ?ZoneLivraison $zonelivraison = null;
  46. #[ORM\ManyToOne(inversedBy: 'livraisonsarrivee')]
  47. private ?ZoneLivraison $zonearrivee = null;
  48. #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  49. private ?\DateTimeInterface $depart = null;
  50. #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  51. private ?\DateTimeInterface $arrivee = null;
  52. #[ORM\ManyToOne(inversedBy: 'livraisons')]
  53. #[ORM\JoinColumn(nullable: true)] // Permet à la relation d’être NULL
  54. private ?PaymentMethod $paymentMethod = null;
  55. #[ORM\ManyToOne(inversedBy: 'livraisons')]
  56. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  57. private ?User $users = null;
  58. #[ORM\Column(length: 255, nullable: true)]
  59. private ?string $photo = null;
  60. #[ORM\Column(nullable: true)]
  61. private ?float $montant = null;
  62. public function getIdLivreurs(): ?Livreurs
  63. {
  64. return $this->id_livreurs;
  65. }
  66. public function setIdLivreurs(?Livreurs $id_livreurs)
  67. {
  68. $this->id_livreurs = $id_livreurs;
  69. return $this;
  70. }
  71. public function getId(): ?int
  72. {
  73. return $this->id;
  74. }
  75. public function getPays(): ?string
  76. {
  77. return $this->pays;
  78. }
  79. public function setPays(string $pays)
  80. {
  81. $this->pays = $pays;
  82. return $this;
  83. }
  84. public function getAdresseDepart(): ?string
  85. {
  86. return $this->adresse_depart;
  87. }
  88. public function setAdresseDepart(string $adresse_depart)
  89. {
  90. $this->adresse_depart = $adresse_depart;
  91. return $this;
  92. }
  93. public function getAdresseArrivee(): ?string
  94. {
  95. return $this->adresse_arrivee;
  96. }
  97. public function setAdresseArrivee(string $adresse_arrivee)
  98. {
  99. $this->adresse_arrivee = $adresse_arrivee;
  100. return $this;
  101. }
  102. public function getPoids(): ?int
  103. {
  104. return $this->poids;
  105. }
  106. public function setPoids(int $poids)
  107. {
  108. $this->poids = $poids;
  109. return $this;
  110. }
  111. public function getTypeLivraison(): ?TypeLivraison
  112. {
  113. return $this->type_livraison;
  114. }
  115. public function setTypeLivraison(?TypeLivraison $type_livraison): static
  116. {
  117. $this->type_livraison = $type_livraison;
  118. return $this;
  119. }
  120. public function getLatitude(): ?string
  121. {
  122. return $this->latitude;
  123. }
  124. public function setLatitude(?string $latitude): static
  125. {
  126. $this->latitude = $latitude;
  127. return $this;
  128. }
  129. public function getLongitude(): ?string
  130. {
  131. return $this->longitude;
  132. }
  133. public function setLongitude(?string $longitude): static
  134. {
  135. $this->longitude = $longitude;
  136. return $this;
  137. }
  138. public function getDistance(): ?float
  139. {
  140. return $this->distance;
  141. }
  142. public function setDistance(float $distance): static
  143. {
  144. $this->distance = $distance;
  145. return $this;
  146. }
  147. public function getStatutLivraison(): ?StatutLivraison
  148. {
  149. return $this->statut_livraison;
  150. }
  151. public function setStatutLivraison(?StatutLivraison $statut_livraison): self
  152. {
  153. $this->statut_livraison = $statut_livraison;
  154. return $this;
  155. }
  156. public function getCreditslivraisons(): ?int
  157. {
  158. return $this->creditslivraisons;
  159. }
  160. public function setCreditslivraisons(int $creditslivraisons): self
  161. {
  162. $this->creditslivraisons = $creditslivraisons;
  163. return $this;
  164. }
  165. public function getDescription(): ?string
  166. {
  167. return $this->description;
  168. }
  169. public function setDescription(string $description): static
  170. {
  171. $this->description = $description;
  172. return $this;
  173. }
  174. public function getUserprofile(): ?string
  175. {
  176. return $this->userprofile;
  177. }
  178. public function setUserprofile(string $userprofile): static
  179. {
  180. $this->userprofile = $userprofile;
  181. return $this;
  182. }
  183. public function getZonelivraison(): ?ZoneLivraison
  184. {
  185. return $this->zonelivraison;
  186. }
  187. public function setZonelivraison(?ZoneLivraison $zonelivraison): static
  188. {
  189. $this->zonelivraison = $zonelivraison;
  190. return $this;
  191. }
  192. public function getZonearrivee(): ?ZoneLivraison
  193. {
  194. return $this->zonearrivee;
  195. }
  196. public function setZonearrivee(?ZoneLivraison $zonearrivee): static
  197. {
  198. $this->zonearrivee = $zonearrivee;
  199. return $this;
  200. }
  201. public function getDepart(): ?\DateTimeInterface
  202. {
  203. return $this->depart;
  204. }
  205. public function setDepart(\DateTimeInterface $depart): static
  206. {
  207. $this->depart = $depart;
  208. return $this;
  209. }
  210. public function getArrivee(): ?\DateTimeInterface
  211. {
  212. return $this->arrivee;
  213. }
  214. public function setArrivee(\DateTimeInterface $arrivee): static
  215. {
  216. $this->arrivee = $arrivee;
  217. return $this;
  218. }
  219. public function getPaymentMethod(): ?PaymentMethod
  220. {
  221. return $this->paymentMethod;
  222. }
  223. public function setPaymentMethod(?PaymentMethod $paymentMethod): static
  224. {
  225. $this->paymentMethod = $paymentMethod;
  226. return $this;
  227. }
  228. public function getUsers(): ?User
  229. {
  230. return $this->users;
  231. }
  232. public function setUsers(?User $users): static
  233. {
  234. $this->users = $users;
  235. return $this;
  236. }
  237. public function getPhoto(): ?string
  238. {
  239. return $this->photo;
  240. }
  241. public function setPhoto(?string $photo): static
  242. {
  243. $this->photo = $photo;
  244. return $this;
  245. }
  246. public function getMontant(): ?float
  247. {
  248. return $this->montant;
  249. }
  250. public function setMontant(?float $montant): static
  251. {
  252. $this->montant = $montant;
  253. return $this;
  254. }
  255. }