src/Entity/Bus/BookingSeat.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Bus;
  3. use App\Entity\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use JMS\Serializer\Annotation as JMS;
  7. /**
  8. * @ORM\Entity(repositoryClass="App\Repository\Bus\BookingSeatRepository")
  9. * @ORM\Table(name="bus_booking_seat")
  10. */
  11. class BookingSeat {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue(strategy="AUTO")
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @Assert\NotBlank(message="Please enter passenger name")
  20. * @ORM\Column(type="string")
  21. */
  22. private $passenger;
  23. /**
  24. * @Assert\NotBlank(message="Please enter phone number")
  25. * @ORM\Column(type="string")
  26. */
  27. private $phone;
  28. /**
  29. * @Assert\NotBlank(message="Please select from")
  30. * @var Stop|null
  31. * @ORM\ManyToOne(targetEntity="App\Entity\Bus\Stop")
  32. * @ORM\JoinColumns({
  33. * @ORM\JoinColumn(name="origin", referencedColumnName="id")
  34. * })
  35. * @JMS\MaxDepth(2)
  36. */
  37. private ?Stop $origin = null;
  38. /**
  39. * @Assert\NotBlank(message="Please enter destination")
  40. * @var Stop|null
  41. * @ORM\ManyToOne(targetEntity="App\Entity\Bus\Stop")
  42. * @ORM\JoinColumns({
  43. * @ORM\JoinColumn(name="destination", referencedColumnName="id")
  44. * })
  45. *
  46. * @JMS\MaxDepth(2)
  47. */
  48. private ?Stop $destination = null;
  49. /**
  50. * @Assert\NotBlank(message="Please select seat")
  51. * @var Seat|null
  52. * @ORM\ManyToOne(targetEntity="App\Entity\Bus\Seat")
  53. * @ORM\JoinColumns({
  54. * @ORM\JoinColumn(name="seat_id", referencedColumnName="id", nullable=true)
  55. * })
  56. * @JMS\MaxDepth(2)
  57. */
  58. private ?Seat $seat = null;
  59. /**
  60. * @ORM\Column(type="time")
  61. * @JMS\Type("DateTime<'H:i'>")
  62. */
  63. private ?\DateTimeInterface $departureTime = null;
  64. /**
  65. * @ORM\Column(type="time")
  66. * @JMS\Type("DateTime<'H:i'>")
  67. */
  68. private ?\DateTimeInterface $eta = null;
  69. /**
  70. * @Assert\NotBlank(message="Please select amount")
  71. * @ORM\Column(type="integer")
  72. */
  73. private $amount;
  74. /**
  75. * @Assert\NotBlank(message="Please enter payment method")
  76. * @ORM\Column(type="string")
  77. */
  78. private $paidVia;
  79. /**
  80. * @var User
  81. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  82. * @ORM\JoinColumns({
  83. * @ORM\JoinColumn(name="created_by", referencedColumnName="id")
  84. * })
  85. * @JMS\MaxDepth(1)
  86. */
  87. private $createdBy;
  88. /**
  89. * Groups this seat with the other seats bought in the same booking.
  90. * Nullable: seats booked through the counter flow (one seat per form
  91. * submission, no grouping concept) will never have one — only seats
  92. * created through the online booking flow set this.
  93. *
  94. * @var Booking|null
  95. * @ORM\ManyToOne(targetEntity="App\Entity\Bus\Booking")
  96. * @ORM\JoinColumns({
  97. * @ORM\JoinColumn(name="booking_id", referencedColumnName="id", nullable=true)
  98. * })
  99. * @JMS\MaxDepth(1)
  100. */
  101. private $booking;
  102. /**
  103. * @ORM\Column(type="datetime")
  104. */
  105. private $createdAt;
  106. /**
  107. * @return mixed
  108. */
  109. public function getId()
  110. {
  111. return $this->id;
  112. }
  113. /**
  114. * @param mixed $id
  115. */
  116. public function setId($id): void
  117. {
  118. $this->id = $id;
  119. }
  120. /**
  121. * @return Stop|null
  122. */
  123. public function getOrigin(): ?Stop
  124. {
  125. return $this->origin ?? null;
  126. }
  127. /**
  128. * @param Stop|null $origin
  129. */
  130. public function setOrigin(?Stop $origin): void
  131. {
  132. $this->origin = $origin;
  133. }
  134. /**
  135. * @return Stop|null
  136. */
  137. public function getDestination(): ?Stop
  138. {
  139. return $this->destination ?? null;
  140. }
  141. /**
  142. * @param Stop|null $destination
  143. */
  144. public function setDestination(?Stop $destination): void
  145. {
  146. $this->destination = $destination;
  147. }
  148. /**
  149. * @return Seat|null
  150. */
  151. public function getSeat(): ?Seat
  152. {
  153. return $this->seat ?? null;
  154. }
  155. /**
  156. * @param Seat|null $seat
  157. */
  158. public function setSeat(?Seat $seat): void
  159. {
  160. $this->seat = $seat;
  161. }
  162. /**
  163. * @return mixed
  164. */
  165. public function getAmount()
  166. {
  167. return $this->amount;
  168. }
  169. /**
  170. * @param mixed $amount
  171. */
  172. public function setAmount($amount): void
  173. {
  174. $this->amount = $amount;
  175. }
  176. /**
  177. * @return mixed
  178. */
  179. public function getPaidVia()
  180. {
  181. return $this->paidVia;
  182. }
  183. /**
  184. * @param mixed $paidVia
  185. */
  186. public function setPaidVia($paidVia): void
  187. {
  188. $this->paidVia = $paidVia;
  189. }
  190. /**
  191. * @return User
  192. */
  193. public function getCreatedBy(): User
  194. {
  195. return $this->createdBy;
  196. }
  197. /**
  198. * @return Booking|null
  199. */
  200. public function getBooking(): ?Booking
  201. {
  202. return $this->booking;
  203. }
  204. /**
  205. * @param Booking|null $booking
  206. */
  207. public function setBooking(?Booking $booking): void
  208. {
  209. $this->booking = $booking;
  210. }
  211. /**
  212. * @param User $createdBy
  213. */
  214. public function setCreatedBy(User $createdBy): void
  215. {
  216. $this->createdBy = $createdBy;
  217. }
  218. /**
  219. * @return mixed
  220. */
  221. public function getCreatedAt()
  222. {
  223. return $this->createdAt;
  224. }
  225. /**
  226. * @param mixed $createdAt
  227. */
  228. public function setCreatedAt($createdAt): void
  229. {
  230. $this->createdAt = $createdAt;
  231. }
  232. /**
  233. * @return mixed
  234. */
  235. public function getPassenger()
  236. {
  237. return $this->passenger;
  238. }
  239. /**
  240. * @param mixed $passenger
  241. */
  242. public function setPassenger($passenger): void
  243. {
  244. $this->passenger = $passenger;
  245. }
  246. /**
  247. * @return mixed
  248. */
  249. public function getPhone()
  250. {
  251. return $this->phone;
  252. }
  253. /**
  254. * @param mixed $phone
  255. */
  256. public function setPhone($phone): void
  257. {
  258. $this->phone = $phone;
  259. }
  260. public function getDepartureTime(): ?\DateTimeInterface
  261. {
  262. return $this->departureTime ?? null;
  263. }
  264. public function setDepartureTime(?\DateTimeInterface $departureTime): void
  265. {
  266. $this->departureTime = $departureTime;
  267. }
  268. public function getEta(): ?\DateTimeInterface
  269. {
  270. return $this->eta ?? null;
  271. }
  272. public function setEta(?\DateTimeInterface $eta): void
  273. {
  274. $this->eta = $eta;
  275. }
  276. }