src/AdminBundle/Entity/DriverHistoryQueue.php line 13

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * DriverHistoryQueue
  7. */
  8. #[ORM\Table(name: 'driver_history_queue')]
  9. #[ORM\Entity(repositoryClass: \AdminBundle\Repository\DriverHistoryQueueRepository::class)]
  10. class DriverHistoryQueue
  11. {
  12. /**
  13. * @var int
  14. */
  15. #[ORM\Column(name: 'id', type: 'integer')]
  16. #[ORM\Id]
  17. #[ORM\GeneratedValue(strategy: 'AUTO')]
  18. private $id;
  19. /**
  20. * @var Driver
  21. */
  22. #[ORM\JoinColumn(name: 'driver_id', referencedColumnName: 'id', nullable: false)]
  23. #[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\Driver::class, inversedBy: 'driverHistoryQueues')]
  24. protected $driver;
  25. /**
  26. * @var Area
  27. */
  28. #[ORM\JoinColumn(name: 'area_id', referencedColumnName: 'id', nullable: false)]
  29. #[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\Area::class, inversedBy: 'driverHistoryQueues')]
  30. protected $area;
  31. /**
  32. * @var boolean
  33. */
  34. #[ORM\Column(name: 'queue_time_completed', type: 'boolean', options: ['default' => 0])]
  35. protected $queueTimeCompleted = false;
  36. /**
  37. * @var boolean
  38. */
  39. #[ORM\Column(name: 'booking_dispatched', type: 'boolean', options: ['default' => 0])]
  40. protected $bookingDispatched = false;
  41. /**
  42. * @var string
  43. */
  44. #[ORM\Column(name: 'leave_reason', type: 'text', nullable: true)]
  45. protected $leaveReason;
  46. /**
  47. * @var DateTime
  48. */
  49. #[ORM\Column(name: 'created_at', type: 'datetime')]
  50. protected $createdAt;
  51. /**
  52. * @var DateTime
  53. */
  54. #[ORM\Column(name: 'leaved_at', type: 'datetime', nullable: true)]
  55. protected $leavedAt;
  56. /**
  57. * @var int
  58. */
  59. #[ORM\Column(name: 'priority', type: 'integer', nullable: false, options: ['default' => 0])]
  60. private $priority;
  61. public function __construct()
  62. {
  63. $this->createdAt = new DateTime();
  64. $this->priority = 0;
  65. }
  66. /**
  67. * @return int
  68. */
  69. public function getId()
  70. {
  71. return $this->id;
  72. }
  73. /**
  74. * @return Driver
  75. */
  76. public function getDriver()
  77. {
  78. return $this->driver;
  79. }
  80. /**
  81. * @param Driver $driver
  82. *
  83. * @return DriverHistoryQueue
  84. */
  85. public function setDriver(Driver $driver)
  86. {
  87. $this->driver = $driver;
  88. return $this;
  89. }
  90. /**
  91. * @return Area
  92. */
  93. public function getArea()
  94. {
  95. return $this->area;
  96. }
  97. /**
  98. * @param Area $area
  99. *
  100. * @return DriverHistoryQueue
  101. */
  102. public function setArea(Area $area)
  103. {
  104. $this->area = $area;
  105. return $this;
  106. }
  107. /**
  108. * @return bool
  109. */
  110. public function getQueueTimeCompleted()
  111. {
  112. return $this->queueTimeCompleted;
  113. }
  114. /**
  115. * @param bool $queueTimeCompleted
  116. *
  117. * @return DriverHistoryQueue
  118. */
  119. public function setQueueTimeCompleted(bool $queueTimeCompleted)
  120. {
  121. $this->queueTimeCompleted = $queueTimeCompleted;
  122. return $this;
  123. }
  124. /**
  125. * @return bool
  126. */
  127. public function getBookingDispatched()
  128. {
  129. return $this->bookingDispatched;
  130. }
  131. /**
  132. * @param bool $bookingDispatched
  133. *
  134. * @return DriverHistoryQueue
  135. */
  136. public function setBookingDispatched(bool $bookingDispatched)
  137. {
  138. $this->bookingDispatched = $bookingDispatched;
  139. return $this;
  140. }
  141. /**
  142. * @return DateTime
  143. */
  144. public function getCreatedAt()
  145. {
  146. return $this->createdAt;
  147. }
  148. /**
  149. * @param DateTime $createdAt
  150. *
  151. * @return DriverHistoryQueue
  152. */
  153. public function setCreatedAt(DateTime $createdAt)
  154. {
  155. $this->createdAt = $createdAt;
  156. return $this;
  157. }
  158. /**
  159. * @return DateTime
  160. */
  161. public function getLeavedAt()
  162. {
  163. return $this->leavedAt;
  164. }
  165. /**
  166. * @param DateTime $leavedAt
  167. *
  168. * @return DriverHistoryQueue
  169. */
  170. public function setLeavedAt(DateTime $leavedAt)
  171. {
  172. $this->leavedAt = $leavedAt;
  173. return $this;
  174. }
  175. /**
  176. * @return string
  177. */
  178. public function getLeaveReason()
  179. {
  180. return $this->leaveReason;
  181. }
  182. /**
  183. * @param string $leaveReason
  184. *
  185. * @return DriverHistoryQueue
  186. */
  187. public function setLeaveReason(string $leaveReason)
  188. {
  189. $this->leaveReason = $leaveReason;
  190. return $this;
  191. }
  192. /**
  193. * @return int
  194. */
  195. public function getPriority()
  196. {
  197. return $this->priority;
  198. }
  199. /**
  200. * @param int $priority
  201. *
  202. * @return DriverHistoryQueue
  203. */
  204. public function setPriority(int $priority)
  205. {
  206. $this->priority = $priority;
  207. return $this;
  208. }
  209. }