src/AdminBundle/Entity/UnassignedBookingsDriverRequests.php line 11

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. #[ORM\Table(name: 'unassigned_bookings_driver_requests')]
  6. #[ORM\Entity(repositoryClass: \AdminBundle\Repository\UnassignedBookingsDriverRequestsRepository::class)]
  7. #[ORM\HasLifecycleCallbacks]
  8. class UnassignedBookingsDriverRequests extends BaseEntity
  9. {
  10. const STATUS_WAITING = 0;
  11. const STATUS_APPROVED = 1;
  12. const STATUS_REJECTED = 2;
  13. const STATUS_DEALLOCATED = 3;
  14. /**
  15. * @var integer
  16. */
  17. #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
  18. #[ORM\Id]
  19. #[ORM\GeneratedValue(strategy: 'IDENTITY')]
  20. protected $id;
  21. /**
  22. * @var Booking
  23. */
  24. #[ORM\JoinColumn(name: 'booking_id', referencedColumnName: 'id')]
  25. #[ORM\ManyToOne(targetEntity: \Booking::class, inversedBy: 'unassignedDriverRequests', cascade: ['all'])]
  26. protected $booking;
  27. /**
  28. * @var string
  29. */
  30. #[ORM\Column(name: 'linked_booking', type: 'string', length: 100, nullable: true)]
  31. protected $linkedBooking;
  32. /**
  33. * @var string
  34. */
  35. #[ORM\Column(name: 'main_booking', type: 'string', length: 100, nullable: true)]
  36. protected $mainBooking;
  37. /**
  38. * @var string
  39. */
  40. #[ORM\Column(name: 'verified', type: 'boolean', nullable: true, options: ['default' => 0])]
  41. protected $verified = false;
  42. /**
  43. * @var Driver
  44. */
  45. #[ORM\JoinColumn(name: 'driver_id', referencedColumnName: 'id')]
  46. #[ORM\ManyToOne(targetEntity: \Driver::class, inversedBy: 'unassignedBookingsRequests', cascade: ['all'])]
  47. protected $driver;
  48. /**
  49. * @var \DateTime
  50. */
  51. #[ORM\Column(name: 'date', type: 'date')]
  52. protected $date;
  53. /**
  54. * @var \DateTime
  55. */
  56. #[ORM\Column(name: 'updated', type: 'datetime', nullable: true)]
  57. protected $updated;
  58. /**
  59. * @var \DateTime
  60. */
  61. #[ORM\Column(name: 'created', type: 'datetime', nullable: true)]
  62. protected $created;
  63. /**
  64. * @var integer
  65. */
  66. #[ORM\Column(name: 'status', type: 'integer')]
  67. protected $status = self::STATUS_WAITING;
  68. public function __construct()
  69. {
  70. $this->date = new \DateTime();
  71. $this->updated = new \DateTime();
  72. $this->created = new \DateTime();
  73. $this->status = self::STATUS_WAITING;
  74. }
  75. /**
  76. * @return Booking
  77. */
  78. public function getBooking()
  79. {
  80. return $this->booking;
  81. }
  82. /**
  83. * @param Booking $booking
  84. */
  85. public function setBooking($booking)
  86. {
  87. $this->booking = $booking;
  88. }
  89. /**
  90. * @return \DateTime
  91. */
  92. public function getDate()
  93. {
  94. return $this->date;
  95. }
  96. /**
  97. * @param \DateTime $date
  98. */
  99. public function setDate($date)
  100. {
  101. $this->date = $date;
  102. }
  103. /**
  104. * @return int
  105. */
  106. public function getId()
  107. {
  108. return $this->id;
  109. }
  110. /**
  111. * @param int $id
  112. */
  113. public function setId($id)
  114. {
  115. $this->id = $id;
  116. }
  117. /**
  118. * @return Driver
  119. */
  120. public function getDriver()
  121. {
  122. return $this->driver;
  123. }
  124. /**
  125. * @param Driver $driver
  126. */
  127. public function setDriver($driver)
  128. {
  129. $this->driver = $driver;
  130. }
  131. /**
  132. * @return int
  133. */
  134. public function getStatus()
  135. {
  136. return $this->status;
  137. }
  138. /**
  139. * @param int $status
  140. */
  141. public function setStatus($status)
  142. {
  143. $this->status = $status;
  144. }
  145. /**
  146. * @return \DateTime
  147. */
  148. public function getUpdated()
  149. {
  150. return $this->updated;
  151. }
  152. /**
  153. * @param \DateTime $updated
  154. */
  155. public function setUpdated(\DateTime $updated)
  156. {
  157. $this->updated = $updated;
  158. }
  159. /**
  160. * @return \DateTime
  161. */
  162. public function getCreated()
  163. {
  164. return $this->created;
  165. }
  166. /**
  167. * @param \DateTime $created
  168. */
  169. public function setCreated(\DateTime $created)
  170. {
  171. $this->created = $created;
  172. }
  173. #[ORM\PrePersist]
  174. #[ORM\PreUpdate]
  175. public function updatedTimestamps()
  176. {
  177. $this->setUpdated(new \DateTime());
  178. }
  179. /**
  180. * @return string
  181. */
  182. public function getLinkedBooking()
  183. {
  184. return $this->linkedBooking;
  185. }
  186. /**
  187. * @param string $linkedBooking
  188. */
  189. public function setLinkedBooking($linkedBooking)
  190. {
  191. $this->linkedBooking = $linkedBooking;
  192. }
  193. /**
  194. * @return string
  195. */
  196. public function getVerified()
  197. {
  198. return $this->verified;
  199. }
  200. /**
  201. * @param string $verified
  202. */
  203. public function setVerified($verified)
  204. {
  205. $this->verified = $verified;
  206. }
  207. /**
  208. * @return string
  209. */
  210. public function getMainBooking()
  211. {
  212. return $this->mainBooking;
  213. }
  214. /**
  215. * @param string $mainBooking
  216. */
  217. public function setMainBooking($mainBooking)
  218. {
  219. $this->mainBooking = $mainBooking;
  220. }
  221. }