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
  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;
  38. /**
  39. * @Assert\NotBlank(message="Please enter destination")
  40. * @var Stop
  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;
  49. /**
  50. * @Assert\NotBlank(message="Please select seat")
  51. * @var Seat
  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;
  59. /**
  60. * @ORM\Column(type="time")
  61. * @JMS\Type("DateTime<'H:i'>")
  62. */
  63. private \DateTimeInterface $departureTime;
  64. /**
  65. * @ORM\Column(type="time")
  66. * @JMS\Type("DateTime<'H:i'>")
  67. */
  68. private \DateTimeInterface $eta;
  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. * @ORM\Column(type="datetime")
  90. */
  91. private $createdAt;
  92. /**
  93. * @return mixed
  94. */
  95. public function getId()
  96. {
  97. return $this->id;
  98. }
  99. /**
  100. * @param mixed $id
  101. */
  102. public function setId($id): void
  103. {
  104. $this->id = $id;
  105. }
  106. /**
  107. * @return Stop
  108. */
  109. public function getOrigin(): Stop
  110. {
  111. return $this->origin;
  112. }
  113. /**
  114. * @param Stop $origin
  115. */
  116. public function setOrigin(Stop $origin): void
  117. {
  118. $this->origin = $origin;
  119. }
  120. /**
  121. * @return Stop
  122. */
  123. public function getDestination(): Stop
  124. {
  125. return $this->destination;
  126. }
  127. /**
  128. * @param Stop $destination
  129. */
  130. public function setDestination(Stop $destination): void
  131. {
  132. $this->destination = $destination;
  133. }
  134. /**
  135. * @return Seat
  136. */
  137. public function getSeat(): Seat
  138. {
  139. return $this->seat;
  140. }
  141. /**
  142. * @param Seat $seat
  143. */
  144. public function setSeat(Seat $seat): void
  145. {
  146. $this->seat = $seat;
  147. }
  148. /**
  149. * @return mixed
  150. */
  151. public function getAmount()
  152. {
  153. return $this->amount;
  154. }
  155. /**
  156. * @param mixed $amount
  157. */
  158. public function setAmount($amount): void
  159. {
  160. $this->amount = $amount;
  161. }
  162. /**
  163. * @return mixed
  164. */
  165. public function getPaidVia()
  166. {
  167. return $this->paidVia;
  168. }
  169. /**
  170. * @param mixed $paidVia
  171. */
  172. public function setPaidVia($paidVia): void
  173. {
  174. $this->paidVia = $paidVia;
  175. }
  176. /**
  177. * @return User
  178. */
  179. public function getCreatedBy(): User
  180. {
  181. return $this->createdBy;
  182. }
  183. /**
  184. * @param User $createdBy
  185. */
  186. public function setCreatedBy(User $createdBy): void
  187. {
  188. $this->createdBy = $createdBy;
  189. }
  190. /**
  191. * @return mixed
  192. */
  193. public function getCreatedAt()
  194. {
  195. return $this->createdAt;
  196. }
  197. /**
  198. * @param mixed $createdAt
  199. */
  200. public function setCreatedAt($createdAt): void
  201. {
  202. $this->createdAt = $createdAt;
  203. }
  204. /**
  205. * @return mixed
  206. */
  207. public function getPassenger()
  208. {
  209. return $this->passenger;
  210. }
  211. /**
  212. * @param mixed $passenger
  213. */
  214. public function setPassenger($passenger): void
  215. {
  216. $this->passenger = $passenger;
  217. }
  218. /**
  219. * @return mixed
  220. */
  221. public function getPhone()
  222. {
  223. return $this->phone;
  224. }
  225. /**
  226. * @param mixed $phone
  227. */
  228. public function setPhone($phone): void
  229. {
  230. $this->phone = $phone;
  231. }
  232. public function getDepartureTime(): \DateTimeInterface
  233. {
  234. return $this->departureTime;
  235. }
  236. public function setDepartureTime(\DateTimeInterface $departureTime): void
  237. {
  238. $this->departureTime = $departureTime;
  239. }
  240. public function getEta(): \DateTimeInterface
  241. {
  242. return $this->eta;
  243. }
  244. public function setEta(\DateTimeInterface $eta): void
  245. {
  246. $this->eta = $eta;
  247. }
  248. }