src/Entity/Bus/Seat.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Bus;
  3. use App\Entity\User;
  4. use App\Entity\Vehicle;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\Bus\SeatRepository")
  8. * @ORM\Table(name="bus_seat")
  9. */
  10. class Seat {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue(strategy="AUTO")
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @var Trip
  19. * @ORM\ManyToOne(targetEntity="App\Entity\Bus\Trip")
  20. * @ORM\JoinColumns({
  21. * @ORM\JoinColumn(name="trip_id", referencedColumnName="id")
  22. * })
  23. */
  24. private Trip $trip;
  25. /**
  26. * @ORM\Column(type="integer")
  27. */
  28. private $seatNumber;
  29. /**
  30. * @ORM\OneToMany(targetEntity="App\Entity\Bus\BookingSeat", mappedBy="seat", cascade={"persist", "remove"})
  31. */
  32. private $booking;
  33. /**
  34. * @ORM\Column(type="boolean")
  35. */
  36. private $isBooked;
  37. /**
  38. * @ORM\Column(type="string")
  39. */
  40. private $status; // BOOKED, RESERVED, AVAILABLE
  41. /**
  42. * @ORM\Column(type="datetime")
  43. */
  44. private $createdAt;
  45. /**
  46. * @return mixed
  47. */
  48. public function getId()
  49. {
  50. return $this->id;
  51. }
  52. /**
  53. * @param mixed $id
  54. */
  55. public function setId($id): void
  56. {
  57. $this->id = $id;
  58. }
  59. /**
  60. * @return Trip
  61. */
  62. public function getTrip(): Trip
  63. {
  64. return $this->trip;
  65. }
  66. /**
  67. * @param Trip $trip
  68. */
  69. public function setTrip(Trip $trip): void
  70. {
  71. $this->trip = $trip;
  72. }
  73. /**
  74. * @return mixed
  75. */
  76. public function getSeatNumber()
  77. {
  78. return $this->seatNumber;
  79. }
  80. /**
  81. * @param mixed $seatNumber
  82. */
  83. public function setSeatNumber($seatNumber): void
  84. {
  85. $this->seatNumber = $seatNumber;
  86. }
  87. /**
  88. * @return mixed
  89. */
  90. public function getBooking()
  91. {
  92. return $this->booking;
  93. }
  94. /**
  95. * @param mixed $booking
  96. */
  97. public function setBooking($booking): void
  98. {
  99. $this->booking = $booking;
  100. }
  101. /**
  102. * @return mixed
  103. */
  104. public function getIsBooked()
  105. {
  106. return $this->isBooked;
  107. }
  108. /**
  109. * @param mixed $isBooked
  110. */
  111. public function setIsBooked($isBooked): void
  112. {
  113. $this->isBooked = $isBooked;
  114. }
  115. /**
  116. * @return mixed
  117. */
  118. public function getStatus()
  119. {
  120. return $this->status;
  121. }
  122. /**
  123. * @param mixed $status
  124. */
  125. public function setStatus($status): void
  126. {
  127. $this->status = $status;
  128. }
  129. /**
  130. * @return mixed
  131. */
  132. public function getCreatedAt()
  133. {
  134. return $this->createdAt;
  135. }
  136. /**
  137. * @param mixed $createdAt
  138. */
  139. public function setCreatedAt($createdAt): void
  140. {
  141. $this->createdAt = $createdAt;
  142. }
  143. public function __toString()
  144. {
  145. // TODO: Implement __toString() method.
  146. return 'SEAT ['.$this->getSeatNumber().']';
  147. }
  148. }