src/Entity/Bus/Trip.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Bus;
  3. use App\Entity\Station;
  4. use App\Entity\User;
  5. use App\Entity\Vehicle;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation as JMS;
  8. /**
  9. * @ORM\Entity(repositoryClass="App\Repository\Bus\TripRepository")
  10. * @ORM\Table(name="bus_trip")
  11. */
  12. class Trip {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @var Route
  21. *
  22. * @ORM\ManyToOne(targetEntity="App\Entity\Bus\Route")
  23. * @ORM\JoinColumns({
  24. * @ORM\JoinColumn(name="route_id", referencedColumnName="id")
  25. * })
  26. *
  27. * @JMS\MaxDepth(1)
  28. */
  29. private Route $route;
  30. /**
  31. * @ORM\Column(type="datetime")
  32. */
  33. private $createdAt;
  34. /**
  35. * @ORM\Column(type="date")
  36. */
  37. private $tripDate;
  38. /**
  39. * @ORM\Column(type="datetime")
  40. */
  41. private $departureTime;
  42. /**
  43. * @ORM\Column(type="datetime")
  44. */
  45. private $eta;
  46. /**
  47. * @ORM\OneToMany(targetEntity="App\Entity\Bus\Seat", mappedBy="trip", cascade={"persist", "remove"})
  48. */
  49. private $seats;
  50. /**
  51. * @var Station
  52. * @ORM\ManyToOne(targetEntity="App\Entity\Station")
  53. * @ORM\JoinColumns({
  54. * @ORM\JoinColumn(name="origin", referencedColumnName="id")
  55. * })
  56. * @JMS\MaxDepth(1)
  57. */
  58. private $origin;
  59. /**
  60. * @var Station
  61. * @ORM\ManyToOne(targetEntity="App\Entity\Station")
  62. * @ORM\JoinColumns({
  63. * @ORM\JoinColumn(name="destination", referencedColumnName="id")
  64. * })
  65. * @JMS\MaxDepth(1)
  66. */
  67. private $destination;
  68. /**
  69. * @ORM\Column(type="integer")
  70. */
  71. private $fare;
  72. /**
  73. * @ORM\Column(type="integer")
  74. */
  75. private $tripIndex;
  76. /**
  77. * @var User
  78. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  79. * @ORM\JoinColumns({
  80. * @ORM\JoinColumn(name="created_by", referencedColumnName="id")
  81. * })
  82. * @JMS\MaxDepth(1)
  83. */
  84. private User $createdBy;
  85. /**
  86. * @var Vehicle
  87. * @ORM\ManyToOne(targetEntity="App\Entity\Vehicle")
  88. * @ORM\JoinColumns({
  89. * @ORM\JoinColumn(name="vehicle", referencedColumnName="id")
  90. * })
  91. * @JMS\MaxDepth(1)
  92. */
  93. private $vehicle;
  94. /**
  95. * @ORM\Column(type="boolean")
  96. */
  97. private $vehicleIsApproved;
  98. /**
  99. * @return mixed
  100. */
  101. public function getId()
  102. {
  103. return $this->id;
  104. }
  105. /**
  106. * @param mixed $id
  107. */
  108. public function setId($id): void
  109. {
  110. $this->id = $id;
  111. }
  112. /**
  113. * @return mixed
  114. */
  115. public function getRoute()
  116. {
  117. return $this->route;
  118. }
  119. /**
  120. * @param mixed $route
  121. */
  122. public function setRoute($route): void
  123. {
  124. $this->route = $route;
  125. }
  126. /**
  127. * @return mixed
  128. */
  129. public function getCreatedAt()
  130. {
  131. return $this->createdAt;
  132. }
  133. /**
  134. * @param mixed $createdAt
  135. */
  136. public function setCreatedAt($createdAt): void
  137. {
  138. $this->createdAt = $createdAt;
  139. }
  140. /**
  141. * @return mixed
  142. */
  143. public function getTripDate()
  144. {
  145. return $this->tripDate;
  146. }
  147. /**
  148. * @param mixed $tripDate
  149. */
  150. public function setTripDate($tripDate): void
  151. {
  152. $this->tripDate = $tripDate;
  153. }
  154. /**
  155. * @return mixed
  156. */
  157. public function getSeats()
  158. {
  159. return $this->seats;
  160. }
  161. /**
  162. * @param mixed $seats
  163. */
  164. public function setSeats($seats): void
  165. {
  166. $this->seats = $seats;
  167. }
  168. /**
  169. * @return mixed
  170. */
  171. public function getTripIndex()
  172. {
  173. return $this->tripIndex;
  174. }
  175. /**
  176. * @param mixed $tripIndex
  177. */
  178. public function setTripIndex($tripIndex): void
  179. {
  180. $this->tripIndex = $tripIndex;
  181. }
  182. public function getOrigin(): Station
  183. {
  184. return $this->origin;
  185. }
  186. public function setOrigin(Station $origin): void
  187. {
  188. $this->origin = $origin;
  189. }
  190. public function getDestination(): Station
  191. {
  192. return $this->destination;
  193. }
  194. public function setDestination(Station $destination): void
  195. {
  196. $this->destination = $destination;
  197. }
  198. /**
  199. * @return User
  200. */
  201. public function getCreatedBy(): User
  202. {
  203. return $this->createdBy;
  204. }
  205. /**
  206. * @param User $createdBy
  207. */
  208. public function setCreatedBy(User $createdBy): void
  209. {
  210. $this->createdBy = $createdBy;
  211. }
  212. /**
  213. * @return mixed
  214. */
  215. public function getFare()
  216. {
  217. return $this->fare;
  218. }
  219. /**
  220. * @param mixed $fare
  221. */
  222. public function setFare($fare): void
  223. {
  224. $this->fare = $fare;
  225. }
  226. public function getVehicle(): Vehicle
  227. {
  228. return $this->vehicle;
  229. }
  230. public function setVehicle(Vehicle $vehicle): void
  231. {
  232. $this->vehicle = $vehicle;
  233. }
  234. /**
  235. * @return mixed
  236. */
  237. public function getVehicleIsApproved()
  238. {
  239. return $this->vehicleIsApproved;
  240. }
  241. /**
  242. * @param mixed $vehicleIsApproved
  243. */
  244. public function setVehicleIsApproved($vehicleIsApproved): void
  245. {
  246. $this->vehicleIsApproved = $vehicleIsApproved;
  247. }
  248. /**
  249. * @return mixed
  250. */
  251. public function getDepartureTime()
  252. {
  253. return $this->departureTime;
  254. }
  255. /**
  256. * @param mixed $departureTime
  257. */
  258. public function setDepartureTime($departureTime): void
  259. {
  260. $this->departureTime = $departureTime;
  261. }
  262. /**
  263. * @return mixed
  264. */
  265. public function getEta()
  266. {
  267. return $this->eta;
  268. }
  269. /**
  270. * @param mixed $eta
  271. */
  272. public function setEta($eta): void
  273. {
  274. $this->eta = $eta;
  275. }
  276. }