src/AdminBundle/Entity/BookingHistory.php line 10

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table(name: 'booking_history')]
  6. #[ORM\Entity]
  7. class BookingHistory extends BaseEntity
  8. {
  9. const ACTION_TYPE_CHANGED_STATUS = 0;
  10. const ACTION_TYPE_CHANGED_DRIVER = 1;
  11. const ACTION_TYPE_NEW_BOOKING = 2;
  12. const ACTION_TYPE_BROADCAST = 3;
  13. const ACTION_TYPE_SEND_EMAIL = 4;
  14. const ACTION_TYPE_UPDATE_BOOKING_PAYMENT_AMOUNT = 5;
  15. const ACTION_TYPE_FLIGHT_NOT_LATE = 6;
  16. const ACTION_TYPE_FLIGHT_LATE = 7;
  17. const ACTION_TYPE_GENERATE_INVOICE = 8;
  18. const ACTION_TYPE_UPDATE_BOOKING = 9;
  19. const ACTION_TYPE_AUTO_ASSIGNED_BOOKING = 10;
  20. const ACTION_TYPE_ADDED_REVIEW = 11;
  21. const ACTION_TYPE_ADD_BOOKING_FROM_ASAP = 12;
  22. const ACTION_TYPE_PAYMENT = 13;
  23. const ACTION_TYPE_CALCULATED_DISTANCE_AND_DURATION = 14;
  24. const ACTION_TYPE_LIVE_UPDATE = 15;
  25. const ACTION_DRIVER_SHIFT_TEST = 99;
  26. /**
  27. * @var int
  28. */
  29. #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
  30. #[ORM\Id]
  31. #[ORM\GeneratedValue(strategy: 'IDENTITY')]
  32. protected $id;
  33. /**
  34. * @var Booking
  35. */
  36. #[ORM\JoinColumn(name: 'booking_id', referencedColumnName: 'id')]
  37. #[ORM\ManyToOne(targetEntity: \Booking::class, inversedBy: 'bookingHistory', cascade: ['all'])]
  38. protected $booking;
  39. #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id')]
  40. #[ORM\ManyToOne(targetEntity: \User::class)]
  41. protected $user;
  42. /**
  43. * @var DateTime
  44. */
  45. #[ORM\Column(name: 'date', type: 'datetime')]
  46. protected $date;
  47. /**
  48. * @var int
  49. */
  50. #[ORM\Column(name: 'action_type', type: 'integer')]
  51. protected $actionType;
  52. /**
  53. * @var array
  54. */
  55. #[ORM\Column(name: 'payload', type: 'array')]
  56. protected $payload;
  57. public function __construct()
  58. {
  59. $this->date = new DateTime();
  60. }
  61. /**
  62. * @return int
  63. */
  64. public function getId()
  65. {
  66. return $this->id;
  67. }
  68. /**
  69. * @param int $id
  70. *
  71. * @return BookingHistory
  72. */
  73. public function setId($id)
  74. {
  75. $this->id = $id;
  76. return $this;
  77. }
  78. /**
  79. * @return mixed
  80. */
  81. public function getBooking()
  82. {
  83. return $this->booking;
  84. }
  85. /**
  86. * @param mixed $booking
  87. *
  88. * @return BookingHistory
  89. */
  90. public function setBooking($booking)
  91. {
  92. $this->booking = $booking;
  93. return $this;
  94. }
  95. /**
  96. * @return mixed
  97. */
  98. public function getUser()
  99. {
  100. return $this->user;
  101. }
  102. /**
  103. * @param mixed $user
  104. *
  105. * @return BookingHistory
  106. */
  107. public function setUser($user)
  108. {
  109. $this->user = $user;
  110. return $this;
  111. }
  112. /**
  113. * @return DateTime
  114. */
  115. public function getDate()
  116. {
  117. return $this->date;
  118. }
  119. /**
  120. * @param DateTime $date
  121. *
  122. * @return BookingHistory
  123. */
  124. public function setDate($date)
  125. {
  126. $this->date = $date;
  127. return $this;
  128. }
  129. /**
  130. * @return int
  131. */
  132. public function getActionType()
  133. {
  134. return $this->actionType;
  135. }
  136. /**
  137. * @param int $actionType
  138. *
  139. * @return BookingHistory
  140. */
  141. public function setActionType($actionType)
  142. {
  143. $this->actionType = $actionType;
  144. return $this;
  145. }
  146. /**
  147. * @return array
  148. */
  149. public function getPayload()
  150. {
  151. return $this->payload;
  152. }
  153. /**
  154. * @param array $payload
  155. *
  156. * @return BookingHistory
  157. */
  158. public function setPayload($payload)
  159. {
  160. $this->payload = $payload;
  161. return $this;
  162. }
  163. }