src/AdminBundle/Entity/BookingRequest.php line 21

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Criteria;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints\DateTime;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Doctrine\ORM\Mapping\OrderBy;
  9. #[ORM\Table(name: 'booking_request')]
  10. #[ORM\Index(name: 'status_date_index', columns: ['booking_status', 'pick_up_date', 'pick_up_time'])]
  11. #[ORM\Index(name: 'pickup_address_index', columns: ['pick_up_address', 'booking_status'])]
  12. #[ORM\Index(name: 'destination_address_index', columns: ['destination_address', 'booking_status'])]
  13. #[ORM\Index(name: 'client_first_name_index', columns: ['client_first_name', 'booking_status'])]
  14. #[ORM\Index(name: 'client_last_name_index', columns: ['client_last_name', 'booking_status'])]
  15. #[ORM\Index(name: 'client_email_index', columns: ['client_email', 'booking_status'])]
  16. #[ORM\Index(name: 'client_phone_index', columns: ['client_phone', 'booking_status'])]
  17. #[ORM\Entity(repositoryClass: \AdminBundle\Repository\BookingRequestRepository::class)]
  18. class BookingRequest extends BaseEntity
  19. {
  20. const STATUS_DELETED = 0;
  21. const STATUS_NEW_BOOKING = 1; //New booking in the web app system - not allocated/not dispatched
  22. const STATUS_DISPATCHED = 10; //Booking Dispatched to specific driver X
  23. const STATUS_DRIVER_REJECT = 11; //Driver X reject booking
  24. const STATUS_DRIVER_ACCEPT = 12; // Driver X accept booking
  25. const STATUS_ON_THE_WAY = 13; // The driver is on the way
  26. const STATUS_ARRIVED_AND_WAITING = 14; // The driver arrived and waiting passenger
  27. const STATUS_PASSENGER_ON_BOARD = 15; // Passenger up to car
  28. const STATUS_ABOUT_TO_DROP = 16; // almost at destination
  29. const STATUS_COMPLETED = 17;
  30. const STATUS_BROADCAST = 20; // booking sent to all available / qualified drivers
  31. const STATUS_ARCHIVED = 21; // booking sent to archive
  32. const STATUS_DEALLOCATED_ON_DEMAND = 25; //Before pick up
  33. const STATUS_DEALLOCATED_LATE_PICKUP = 26; //Before pick up
  34. const STATUS_DEALLOCATED_NO_LONGER_AVAILABLE = 27; //Before pick up
  35. const STATUS_DEALLOCATED_CAR_BROKE_DOWN = 28; //Before pick up
  36. const STATUS_DEALLOCATED_OFFICE = 29; //Before pick up
  37. const STATUS_CANCELLED_OTHER_REASON = 30; //Cancellation with no defined reason
  38. const STATUS_CLIENT_CANCELLATION = 31;
  39. const STATUS_CLIENT_NOT_SHOW_UP = 32;
  40. const STATUS_CAR_BROKE_DOWN = 33; // the part with timer
  41. const STATUS_OFFICE_CANCELLATION = 34; //headquarter initiated cancellation
  42. const STATUS_PENDING = 90; //New booking but not paid ( external sources - website )
  43. const STATUS_PENDING_CANCELLATION = 91; //Special status from the office due to non payment
  44. static $statusTypes = [
  45. self::STATUS_DELETED => 'Deleted',
  46. self::STATUS_NEW_BOOKING => 'New booking',
  47. self::STATUS_DISPATCHED => 'Dispatched',
  48. self::STATUS_DRIVER_REJECT => 'Dispatched reject',
  49. self::STATUS_DRIVER_ACCEPT => 'Dispatched accept',
  50. self::STATUS_ON_THE_WAY => 'On the way',
  51. self::STATUS_ARRIVED_AND_WAITING => 'Arrived and waiting',
  52. self::STATUS_PASSENGER_ON_BOARD => 'Passenger on board',
  53. self::STATUS_ABOUT_TO_DROP => 'About to drop',
  54. self::STATUS_COMPLETED => 'Completed',
  55. self::STATUS_ARCHIVED => 'Archived',
  56. self::STATUS_BROADCAST => 'ASAP Notification',
  57. self::STATUS_DEALLOCATED_ON_DEMAND => 'Deallocated on demand',
  58. self::STATUS_DEALLOCATED_LATE_PICKUP => 'Deallocated - Late for pickup',
  59. self::STATUS_DEALLOCATED_NO_LONGER_AVAILABLE => 'Deallocated - No longer available',
  60. self::STATUS_DEALLOCATED_CAR_BROKE_DOWN => 'Deallocated - Car broke down',
  61. self::STATUS_DEALLOCATED_OFFICE => 'Deallocated - Office Deallocation',
  62. self::STATUS_CANCELLED_OTHER_REASON => 'Cancelled Other Reason',
  63. self::STATUS_CLIENT_CANCELLATION => 'Client cancellation',
  64. self::STATUS_CLIENT_NOT_SHOW_UP => 'Client didn’t show up',
  65. self::STATUS_CAR_BROKE_DOWN => 'Car broke down',
  66. self::STATUS_OFFICE_CANCELLATION => 'Office cancellation',
  67. self::STATUS_PENDING => 'Pending',
  68. self::STATUS_PENDING_CANCELLATION => 'Pending Cancellation'
  69. ];
  70. /**
  71. * @var integer
  72. */
  73. #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
  74. #[ORM\Id]
  75. #[ORM\GeneratedValue(strategy: 'IDENTITY')]
  76. protected $id;
  77. /**
  78. * @var string
  79. */
  80. #[ORM\Column(name: 'booking_key', type: 'string', length: 255, nullable: false, unique: true)]
  81. protected $key;
  82. /**
  83. * @var string
  84. */
  85. #[ORM\Column(name: 'booking_created_key', type: 'string', length: 255, nullable: true)]
  86. protected $bookingCreatedKey;
  87. /**
  88. * @var integer
  89. */
  90. #[ORM\Column(name: 'booking_status', type: 'integer')]
  91. protected $status = self::STATUS_BROADCAST;
  92. /**
  93. * @var integer
  94. */
  95. #[ORM\Column(name: 'drivers_confirmed_number', type: 'integer')]
  96. protected $driversConfirmedNumber = 0;
  97. /**
  98. * @var CarType
  99. */
  100. #[ORM\JoinColumn(name: 'car_type_id', referencedColumnName: 'id')]
  101. #[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\CarType::class)]
  102. protected $carType;
  103. /**
  104. * @var float
  105. */
  106. #[ORM\Column(name: 'quote_price', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  107. #[Assert\NotBlank]
  108. protected $quotePrice = 0;
  109. /**
  110. * @var float
  111. */
  112. #[ORM\Column(name: 'override_price', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  113. protected $overridePrice = 0;
  114. /**
  115. * @var string
  116. */
  117. #[ORM\Column(name: 'flight_number', type: 'string', length: 260, nullable: true)]
  118. protected $flightNumber;
  119. /**
  120. * @var \DateTime
  121. */
  122. #[ORM\Column(name: 'flight_landing_time', type: 'time', nullable: true)]
  123. protected $flightLandingTime;
  124. /**
  125. * @var \DateTime
  126. */
  127. #[ORM\Column(name: 'waiting_time', type: 'time', nullable: true)]
  128. protected $waitingTime;
  129. /**
  130. * @var \DateTime
  131. */
  132. #[ORM\Column(name: 'job_waiting_time', type: 'time', nullable: true)]
  133. protected $jobWaitingTime;
  134. /**
  135. * @var string
  136. */
  137. #[ORM\Column(name: 'return_flight_number', type: 'string', length: 260, nullable: true)]
  138. protected $returnFlightNumber;
  139. /**
  140. * @var \DateTime
  141. */
  142. #[ORM\Column(name: 'return_flight_landing_time', type: 'time', nullable: true)]
  143. protected $returnFlightLandingTime;
  144. /**
  145. * @var float
  146. */
  147. #[ORM\Column(name: 'driver_price', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  148. protected $driverPrice;
  149. /**
  150. * @var float
  151. */
  152. #[ORM\Column(name: 'return_driver_price', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  153. protected $returnDriverPrice;
  154. /**
  155. * @var float
  156. */
  157. #[ORM\Column(name: 'distance_unit', type: 'float', nullable: true)]
  158. #[Assert\NotBlank]
  159. protected $distanceUnit;
  160. /**
  161. * @var string
  162. */
  163. #[Assert\NotBlank]
  164. #[ORM\Column(name: 'estimated_time', type: 'text', nullable: true, length: 255)]
  165. protected $estimatedTime;
  166. /**
  167. * @var \DateTime
  168. */
  169. #[ORM\Column(name: 'booking_date', type: 'datetime', nullable: true)]
  170. protected $bookingDate;
  171. /**
  172. * @var \DateTime
  173. */
  174. #[ORM\Column(name: 'expire_broadcast_date', type: 'datetime', nullable: true)]
  175. protected $expireBroadcastDate;
  176. /**
  177. * @var Driver
  178. */
  179. #[ORM\JoinColumn(name: 'driver_id', referencedColumnName: 'id')]
  180. #[ORM\ManyToOne(targetEntity: \Driver::class, inversedBy: 'bookings_request')]
  181. protected $driver;
  182. /**
  183. * @var Car
  184. */
  185. #[ORM\JoinColumn(name: 'car_id', referencedColumnName: 'id')]
  186. #[ORM\ManyToOne(targetEntity: \Car::class)]
  187. protected $car;
  188. /**
  189. * @var string
  190. */
  191. #[ORM\Column(name: 'pick_up_address', type: 'string', length: 255, nullable: false)]
  192. protected $pickUpAddress;
  193. /**
  194. * @var float
  195. */
  196. #[ORM\Column(name: 'pmg', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  197. protected $pmg;
  198. /**
  199. * @var float
  200. */
  201. #[ORM\Column(name: 'return_pmg', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  202. protected $returnPmg;
  203. /**
  204. * @var float
  205. */
  206. #[ORM\Column(name: 'pick_up_lat', type: 'float', precision: 10, scale: 6, nullable: true)]
  207. protected $pickUpLat;
  208. /**
  209. * @var float
  210. */
  211. #[ORM\Column(name: 'pick_up_lng', type: 'float', precision: 10, scale: 6, nullable: true)]
  212. protected $pickUpLng;
  213. /**
  214. * @var string
  215. */
  216. #[ORM\Column(name: 'pick_up_post_code', type: 'string', length: 10)]
  217. protected $pickUpPostCode;
  218. /**
  219. * @var \DateTime
  220. */
  221. #[ORM\Column(name: 'pick_up_date', type: 'datetime', nullable: false)]
  222. protected $pickUpDate;
  223. /**
  224. * @var \DateTime
  225. */
  226. #[ORM\Column(name: 'pick_up_time', type: 'time', nullable: false)]
  227. protected $pickUpTime;
  228. /**
  229. * @var \DateTime
  230. */
  231. #[ORM\Column(name: 'pick_up_date_time', type: 'datetime', nullable: true)]
  232. protected $pickUpDateTime;
  233. /**
  234. * @var \DateTime
  235. */
  236. #[ORM\Column(name: 'return_pick_up_date', type: 'datetime', nullable: true)]
  237. protected $returnPickUpDate;
  238. /**
  239. * @var \DateTime
  240. */
  241. #[ORM\Column(name: 'return_pick_up_time', type: 'time', nullable: true)]
  242. protected $returnPickUpTime;
  243. /**
  244. * @var string
  245. */
  246. #[ORM\Column(name: 'destination_address', type: 'string', length: 255, nullable: false)]
  247. protected $destinationAddress;
  248. /**
  249. * @var float
  250. */
  251. #[ORM\Column(name: 'destination_lat', type: 'float', precision: 10, scale: 6, nullable: true)]
  252. protected $destinationLat;
  253. /**
  254. * @var float
  255. */
  256. #[ORM\Column(name: 'destination_lng', type: 'float', precision: 10, scale: 6, nullable: true)]
  257. protected $destinationLng;
  258. /**
  259. * @var string
  260. */
  261. #[ORM\Column(name: 'destination_post_code', type: 'string', length: 10)]
  262. protected $destinationPostCode;
  263. /**
  264. * @var integer
  265. */
  266. #[ORM\Column(name: 'passengers_number', type: 'integer', nullable: true)]
  267. protected $passengersNumber = 1;
  268. /**
  269. * @var string
  270. */
  271. #[ORM\Column(name: 'hand_luggage', type: 'string', length: 64, nullable: true)]
  272. protected $handLuggage = 0;
  273. /**
  274. * @var string
  275. */
  276. #[ORM\Column(name: 'checkin_luggage', type: 'string', length: 64, nullable: true)]
  277. protected $checkinLuggage = 0;
  278. /**
  279. * @var string
  280. */
  281. #[ORM\Column(name: 'notes', type: 'text', nullable: true)]
  282. protected $notes;
  283. /**
  284. * @var string
  285. */
  286. #[ORM\Column(name: 'return_booking_notes', type: 'text', nullable: true)]
  287. protected $returnBookingNotes;
  288. /**
  289. * @var string
  290. */
  291. #[ORM\Column(name: 'client_first_name', type: 'string', length: 64, nullable: true)]
  292. protected $clientFirstName;
  293. /**
  294. * @var string
  295. */
  296. #[ORM\Column(name: 'client_last_name', type: 'string', length: 64, nullable: true)]
  297. protected $clientLastName;
  298. /**
  299. * @var string
  300. */
  301. #[ORM\Column(name: 'client_phone', type: 'string', length: 64, nullable: true)]
  302. protected $clientPhone;
  303. /**
  304. * @var string
  305. */
  306. #[ORM\Column(name: 'client_email', type: 'string', length: 64, nullable: true)]
  307. protected $clientEmail;
  308. /**
  309. * @var string
  310. */
  311. #[ORM\Column(name: 'client_alternative_phone', type: 'string', length: 64, nullable: true)]
  312. protected $clientAlternativePhone;
  313. /**
  314. * @var string
  315. */
  316. #[ORM\Column(name: 'client_alternative_email', type: 'string', length: 64, nullable: true)]
  317. protected $clientAlternativeEmail;
  318. /**
  319. * @var ArrayCollection
  320. */
  321. #[ORM\OneToMany(targetEntity: \BookingViasAddress::class, mappedBy: 'bookingRequest', cascade: ['persist', 'remove'], orphanRemoval: true)]
  322. protected $vias;
  323. #[ORM\OneToMany(targetEntity: \BookingBookingExtra::class, mappedBy: 'bookingRequest', cascade: ['persist'])]
  324. protected $extras;
  325. /**
  326. * @var User
  327. */
  328. #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true)]
  329. #[ORM\ManyToOne(targetEntity: \User::class, cascade: ['all'])]
  330. protected $clientUser;
  331. /**
  332. * @var string
  333. */
  334. #[ORM\Column(name: 'voucher_code', type: 'string', length: 64, nullable: true)]
  335. protected $voucherCode;
  336. /**
  337. * @var string
  338. */
  339. #[ORM\Column(name: 'voucher_value', type: 'decimal', precision: 7, scale: 2, nullable: true)]
  340. protected $voucherValue;
  341. /**
  342. * @var boolean
  343. */
  344. #[ORM\Column(name: 'create_account', type: 'boolean')]
  345. private $createAccount = true;
  346. /**
  347. * @var BookingRequest
  348. */
  349. #[ORM\JoinColumn(name: 'return_booking_request_id', referencedColumnName: 'id')]
  350. #[ORM\OneToOne(targetEntity: \BookingRequest::class, inversedBy: 'parentBooking', cascade: ['persist', 'remove'])]
  351. protected $returnBooking;
  352. /**
  353. * @var BookingRequest
  354. */
  355. #[ORM\OneToOne(targetEntity: \BookingRequest::class, mappedBy: 'returnBooking')]
  356. protected $parentBooking;
  357. /**
  358. * @var string
  359. */
  360. #[ORM\Column(name: 'booking_data_serialized', type: 'json', nullable: true)]
  361. private $bookingDataSerialized;
  362. /**
  363. * @var string
  364. */
  365. #[ORM\Column(name: 'notified_drivers', type: 'text', nullable: true)]
  366. protected $notifiedDrivers;
  367. public function __construct()
  368. {
  369. $this->driversConfirmedNumber = 0;
  370. $this->bookingDate = new \DateTime();
  371. $this->vias = new ArrayCollection();
  372. $this->extras = new ArrayCollection();
  373. $this->generateKey();
  374. }
  375. public function generateKey()
  376. {
  377. $length = 8;
  378. $this->setKey(strtoupper(substr(md5(uniqid()), mt_rand(0,31 - $length), $length)));
  379. }
  380. /**
  381. * @return int
  382. */
  383. public function getId()
  384. {
  385. return $this->id;
  386. }
  387. /**
  388. * @param int $id
  389. */
  390. public function setId($id)
  391. {
  392. $this->id = $id;
  393. }
  394. /**
  395. * @return string
  396. */
  397. public function getKey()
  398. {
  399. return $this->key;
  400. }
  401. /**
  402. * @param string $key
  403. */
  404. public function setKey($key)
  405. {
  406. $this->key = $key;
  407. }
  408. /**
  409. * @return \DateTime
  410. */
  411. public function getExpireBroadcastDate()
  412. {
  413. return $this->expireBroadcastDate;
  414. }
  415. /**
  416. * @param \DateTime $expireBroadcastDate
  417. */
  418. public function setExpireBroadcastDate($expireBroadcastDate)
  419. {
  420. $this->expireBroadcastDate = $expireBroadcastDate;
  421. }
  422. /**
  423. * @return float
  424. */
  425. public function getQuotePrice()
  426. {
  427. return $this->quotePrice;
  428. }
  429. /**
  430. * @param float $quotePrice
  431. */
  432. public function setQuotePrice($quotePrice)
  433. {
  434. $this->quotePrice = $quotePrice;
  435. }
  436. /**
  437. * @return float
  438. */
  439. public function getOverridePrice()
  440. {
  441. return $this->overridePrice;
  442. }
  443. /**
  444. * @param float $overridePrice
  445. */
  446. public function setOverridePrice($overridePrice)
  447. {
  448. $this->overridePrice = $overridePrice;
  449. }
  450. /**
  451. * @return float
  452. */
  453. public function getDriverPrice()
  454. {
  455. return $this->driverPrice;
  456. }
  457. /**
  458. * @param float $driverPrice
  459. */
  460. public function setDriverPrice($driverPrice)
  461. {
  462. $this->driverPrice = $driverPrice;
  463. }
  464. /**
  465. * @return float
  466. */
  467. public function getReturnDriverPrice()
  468. {
  469. return $this->returnDriverPrice;
  470. }
  471. /**
  472. * @param float $returnDriverPrice
  473. */
  474. public function setReturnDriverPrice($returnDriverPrice)
  475. {
  476. $this->returnDriverPrice = $returnDriverPrice;
  477. }
  478. /**
  479. * @return \DateTime
  480. */
  481. public function getBookingDate()
  482. {
  483. return $this->bookingDate;
  484. }
  485. /**
  486. * @param \DateTime $bookingDate
  487. */
  488. public function setBookingDate($bookingDate)
  489. {
  490. $this->bookingDate = $bookingDate;
  491. }
  492. /**
  493. * @return int
  494. */
  495. public function getStatus()
  496. {
  497. return $this->status;
  498. }
  499. /**
  500. * @param int $status
  501. */
  502. public function setStatus($status)
  503. {
  504. $this->status = $status;
  505. }
  506. /**
  507. * @return int
  508. */
  509. public function getDriversConfirmedNumber()
  510. {
  511. return $this->driversConfirmedNumber;
  512. }
  513. /**
  514. * @param int $driversConfirmedNumber
  515. */
  516. public function setDriversConfirmedNumber($driversConfirmedNumber)
  517. {
  518. $this->driversConfirmedNumber = $driversConfirmedNumber;
  519. }
  520. public function incrementDriversConfirmedNumber()
  521. {
  522. $this->driversConfirmedNumber++;
  523. }
  524. /**
  525. * @return mixed
  526. */
  527. public function getRoundTripBookingId()
  528. {
  529. return $this->roundTripBookingId;
  530. }
  531. /**
  532. * @param mixed $roundTripBookingId
  533. */
  534. public function setRoundTripBookingId($roundTripBookingId)
  535. {
  536. $this->roundTripBookingId = $roundTripBookingId;
  537. }
  538. /**
  539. * @return Driver
  540. */
  541. public function getDriver()
  542. {
  543. return $this->driver;
  544. }
  545. /**
  546. * @param mixed $driver
  547. */
  548. public function setDriver($driver)
  549. {
  550. $this->driver = $driver;
  551. }
  552. /**
  553. * @return Car
  554. */
  555. public function getCar()
  556. {
  557. return $this->car;
  558. }
  559. /**
  560. * @param mixed $car
  561. */
  562. public function setCar($car)
  563. {
  564. $this->car = $car;
  565. }
  566. /**
  567. * @return mixed
  568. */
  569. public function getExtras()
  570. {
  571. return $this->extras;
  572. }
  573. /**
  574. * @param ArrayCollection $extras
  575. */
  576. public function setExtras($extras)
  577. {
  578. $this->extras = $extras;
  579. }
  580. public function addExtra($extra)
  581. {
  582. $this->extras->add($extra);
  583. }
  584. /**
  585. * @return string
  586. */
  587. public function getPickUpAddress()
  588. {
  589. return $this->pickUpAddress;
  590. }
  591. /**
  592. * @param string $pickUpAddress
  593. */
  594. public function setPickUpAddress($pickUpAddress)
  595. {
  596. $this->pickUpAddress = $pickUpAddress;
  597. }
  598. /**
  599. * @return string
  600. */
  601. public function getPickUpTime($timeFormat = 'H:i')
  602. {
  603. if (! $this->pickUpTime) {
  604. return ;
  605. }
  606. return $this->pickUpTime->format($timeFormat);
  607. }
  608. /**
  609. * @param \DateTime|string $pickUpTime
  610. */
  611. public function setPickUpTime($pickUpTime)
  612. {
  613. if (is_string($pickUpTime)) {
  614. $timeArray = explode(':', $pickUpTime);
  615. $pickUpTime = new \DateTime();
  616. $pickUpTime->setTime($timeArray[0], $timeArray[1]);
  617. }
  618. $this->pickUpTime = $pickUpTime;
  619. $this->updatePickUpDateTime();
  620. }
  621. /**
  622. * @return \DateTime
  623. */
  624. public function getPickUpDateTime()
  625. {
  626. return $this->pickUpDateTime;
  627. }
  628. /**
  629. * @return string
  630. */
  631. public function getDestinationAddress()
  632. {
  633. return $this->destinationAddress;
  634. }
  635. /**
  636. * @param string $destinationAddress
  637. */
  638. public function setDestinationAddress($destinationAddress)
  639. {
  640. $this->destinationAddress = $destinationAddress;
  641. }
  642. /**
  643. * @return int
  644. */
  645. public function getPassengersNumber()
  646. {
  647. return $this->passengersNumber;
  648. }
  649. /**
  650. * @param int $passengersNumber
  651. */
  652. public function setPassengersNumber($passengersNumber)
  653. {
  654. $this->passengersNumber = $passengersNumber;
  655. }
  656. public function getStringStatus($statusType)
  657. {
  658. return self::$statusTypes[$statusType];
  659. }
  660. /**
  661. * @return string
  662. */
  663. public function getHandLuggage()
  664. {
  665. return $this->handLuggage;
  666. }
  667. /**
  668. * @param string $handLuggage
  669. */
  670. public function setHandLuggage($handLuggage)
  671. {
  672. $this->handLuggage = $handLuggage;
  673. }
  674. /**
  675. * @return string
  676. */
  677. public function getCheckinLuggage()
  678. {
  679. return $this->checkinLuggage;
  680. }
  681. /**
  682. * @param string $checkinLuggage
  683. */
  684. public function setCheckinLuggage($checkinLuggage)
  685. {
  686. $this->checkinLuggage = $checkinLuggage;
  687. }
  688. /**
  689. * @return string
  690. */
  691. public function getNotes()
  692. {
  693. return $this->notes;
  694. }
  695. /**
  696. * @param string $notes
  697. */
  698. public function setNotes($notes)
  699. {
  700. $this->notes = $notes;
  701. }
  702. /**
  703. * @return User
  704. */
  705. public function getClientUser()
  706. {
  707. return $this->clientUser;
  708. }
  709. /**
  710. * @param User $clientUser
  711. */
  712. public function setClientUser($clientUser)
  713. {
  714. $this->clientUser = $clientUser;
  715. }
  716. /**
  717. * @return string
  718. */
  719. public function getReturnFlightNumber()
  720. {
  721. return $this->returnFlightNumber;
  722. }
  723. /**
  724. * @param string $returnFlightNumber
  725. */
  726. public function setReturnFlightNumber($returnFlightNumber)
  727. {
  728. $this->returnFlightNumber = $returnFlightNumber;
  729. }
  730. /**
  731. * @return string
  732. */
  733. public function getReturnFlightLandingTime()
  734. {
  735. if (! $this->returnFlightLandingTime) {
  736. return ;
  737. }
  738. return $this->returnFlightLandingTime->format('H:i');
  739. }
  740. /**
  741. * @param \DateTime|string $returnFlightLandingTime
  742. */
  743. public function setReturnFlightLandingTime($returnFlightLandingTime)
  744. {
  745. if (is_string($returnFlightLandingTime)) {
  746. $timeArray = explode(':', $returnFlightLandingTime);
  747. $returnFlightLandingTime = new \DateTime();
  748. $returnFlightLandingTime->setTime($timeArray[0], $timeArray[1]);
  749. }
  750. $this->returnFlightLandingTime = $returnFlightLandingTime;
  751. }
  752. /**
  753. * @return \DateTime
  754. */
  755. public function getReturnPickUpDate()
  756. {
  757. return $this->returnPickUpDate;
  758. }
  759. /**
  760. * @param \DateTime $returnPickUpDate
  761. */
  762. public function setReturnPickUpDate($returnPickUpDate)
  763. {
  764. $this->returnPickUpDate = $returnPickUpDate;
  765. }
  766. /**
  767. * @return string
  768. */
  769. public function getReturnPickUpTime()
  770. {
  771. if (! $this->returnPickUpTime) {
  772. return ;
  773. }
  774. return $this->returnPickUpTime->format('H:i');
  775. }
  776. /**
  777. * @param \DateTime $returnPickUpTime
  778. */
  779. public function setReturnPickUpTime($returnPickUpTime)
  780. {
  781. if (is_string($returnPickUpTime)) {
  782. $timeArray = explode(':', $returnPickUpTime);
  783. $returnPickUpTime = new \DateTime();
  784. $returnPickUpTime->setTime($timeArray[0], $timeArray[1]);
  785. }
  786. $this->returnPickUpTime = $returnPickUpTime;
  787. }
  788. /**
  789. * @return string
  790. */
  791. public function getReturnBookingNotes()
  792. {
  793. return $this->returnBookingNotes;
  794. }
  795. /**
  796. * @param string $returnBookingNotes
  797. */
  798. public function setReturnBookingNotes($returnBookingNotes)
  799. {
  800. $this->returnBookingNotes = $returnBookingNotes;
  801. }
  802. /**
  803. * @param boolean $toSecond
  804. * @return \DateTime|int
  805. */
  806. public function getWaitingTime($toSecond = false)
  807. {
  808. if ($toSecond) {
  809. return empty($this->waitingTime) ? 0 : (intval($this->waitingTime->format('H')) * 3600) +
  810. (intval($this->waitingTime->format('i')) * 60) +
  811. intval($this->waitingTime->format('s'));
  812. }
  813. return $this->waitingTime;
  814. }
  815. public function getMgMinutes()
  816. {
  817. if (! $this->flightLandingTime) {
  818. return 0;
  819. }
  820. $pickUpTimeComponents = explode(':', $this->pickUpTime->format('H:i'));
  821. $pickUpTimeInMinutes = intval($pickUpTimeComponents[1]) + (intval($pickUpTimeComponents[0]) * 60);
  822. $flightLandingTimeComponents = explode(':', $this->flightLandingTime->format('H:i'));
  823. $flightLandingTimeInMinutes = intval($flightLandingTimeComponents[1]) + (intval($flightLandingTimeComponents[0]) * 60);
  824. if ($flightLandingTimeInMinutes <= $pickUpTimeInMinutes ) {
  825. return 0;
  826. }
  827. return ($flightLandingTimeInMinutes - $pickUpTimeInMinutes);
  828. }
  829. /**
  830. * @param \DateTime $waitingTime
  831. */
  832. public function setWaitingTime($waitingTime)
  833. {
  834. $this->waitingTime = $waitingTime;
  835. }
  836. /**
  837. * @param bool $toSecond
  838. * @return \DateTime
  839. */
  840. public function getJobWaitingTime($toSecond = false)
  841. {
  842. if ($toSecond) {
  843. return empty($this->jobWaitingTime) ? 0 : (intval($this->jobWaitingTime->format('H')) * 3600) +
  844. (intval($this->jobWaitingTime->format('i')) * 60) +
  845. intval($this->jobWaitingTime->format('s'));
  846. }
  847. return $this->jobWaitingTime;
  848. }
  849. /**
  850. * @param \DateTime $jobWaitingTime
  851. */
  852. public function setJobWaitingTime($jobWaitingTime)
  853. {
  854. $this->jobWaitingTime = $jobWaitingTime;
  855. }
  856. /**
  857. * @return string
  858. */
  859. public function getFlightNumber()
  860. {
  861. return $this->flightNumber;
  862. }
  863. /**
  864. * @param string $flightNumber
  865. */
  866. public function setFlightNumber($flightNumber)
  867. {
  868. $this->flightNumber = $flightNumber;
  869. }
  870. /**
  871. * @return string
  872. */
  873. public function getFlightLandingTime()
  874. {
  875. if (! $this->flightLandingTime) {
  876. return ;
  877. }
  878. return $this->flightLandingTime->format('H:i');
  879. }
  880. /**
  881. * @param \DateTime $flightLandingTime
  882. */
  883. public function setFlightLandingTime($flightLandingTime)
  884. {
  885. if (is_string($flightLandingTime)) {
  886. $timeArray = explode(':', $flightLandingTime);
  887. $flightLandingTime = new \DateTime();
  888. $flightLandingTime->setTime($timeArray[0], $timeArray[1]);
  889. }
  890. $this->flightLandingTime = $flightLandingTime;
  891. }
  892. /**
  893. * @return string
  894. */
  895. public function getClientFirstName()
  896. {
  897. return $this->clientFirstName;
  898. }
  899. /**
  900. * @param string $clientFirstName
  901. */
  902. public function setClientFirstName($clientFirstName)
  903. {
  904. $this->clientFirstName = $clientFirstName;
  905. }
  906. /**
  907. * @return string
  908. */
  909. public function getClientLastName()
  910. {
  911. return $this->clientLastName;
  912. }
  913. /**
  914. * @param string $clientLastName
  915. */
  916. public function setClientLastName($clientLastName)
  917. {
  918. $this->clientLastName = $clientLastName;
  919. }
  920. /**
  921. * @return string
  922. */
  923. public function getClientPhone()
  924. {
  925. return $this->clientPhone;
  926. }
  927. /**
  928. * @param string $clientPhone
  929. */
  930. public function setClientPhone($clientPhone)
  931. {
  932. $this->clientPhone = $clientPhone;
  933. }
  934. /**
  935. * @return string
  936. */
  937. public function getClientEmail()
  938. {
  939. return $this->clientEmail;
  940. }
  941. /**
  942. * @param string $clientEmail
  943. */
  944. public function setClientEmail($clientEmail)
  945. {
  946. $this->clientEmail = $clientEmail;
  947. }
  948. public function getVias()
  949. {
  950. return $this->vias;
  951. }
  952. public function setVias($vias)
  953. {
  954. $this->vias = $vias;
  955. }
  956. public function deleteVias($vias)
  957. {
  958. $this->vias->remove($vias);
  959. $vias->setBookingRequest(null);
  960. }
  961. public function addVias(BookingViasAddress $bookingViasAddress)
  962. {
  963. $this->vias->add($bookingViasAddress);
  964. }
  965. public function getViasAsArray() {
  966. $vias = [];
  967. /** @var BookingViasAddress $via */
  968. foreach ($this->vias as $via) {
  969. $vias[] = $via->getAddress();
  970. }
  971. return $vias;
  972. }
  973. public function getCountVias()
  974. {
  975. return count($this->vias)>0?count($this->vias):' ';
  976. }
  977. public function getObjectivesAsArray()
  978. {
  979. $objectives = [];
  980. $bookingData = json_decode($this->getBookingDataSerialized());
  981. $selectedObjectivesIds = $bookingData->selectedObjectives;
  982. if (! $selectedObjectivesIds) {
  983. return ;
  984. }
  985. $selectedObjectivesHours = $bookingData->selectedObjectivesHours;
  986. $tours = $bookingData->tours;
  987. $selectedObjectiveArrayById = [];
  988. foreach ($tours as $tour) {
  989. foreach ($tour->objectives as $objective) {
  990. $selectedObjectiveArrayById[$objective->id.'-'.$tour->tourId] = $objective;
  991. }
  992. }
  993. foreach ($selectedObjectivesIds as $selectedObjectiveId) {
  994. $objectives[] = [
  995. 'name' => $selectedObjectiveArrayById[$selectedObjectiveId]->title,
  996. 'price' => $selectedObjectiveArrayById[$selectedObjectiveId]->price,
  997. 'hour' => $selectedObjectivesHours->$selectedObjectiveId
  998. ];
  999. }
  1000. return $objectives;
  1001. }
  1002. public function getReturnObjectivesAsArray()
  1003. {
  1004. $returnObjectives = [];
  1005. $bookingData = json_decode($this->getBookingDataSerialized());
  1006. $selectedObjectivesIds = $bookingData->returnSelectedObjectives;
  1007. if (! $selectedObjectivesIds) {
  1008. return ;
  1009. }
  1010. $selectedObjectivesHours = $bookingData->returnSelectedObjectivesHours;
  1011. $tours = $bookingData->tours;
  1012. $selectedObjectiveArrayById = [];
  1013. foreach ($tours as $tour) {
  1014. foreach ($tour->objectives as $objective) {
  1015. $selectedObjectiveArrayById[$objective->id.'-'.$tour->tourId] = $objective;
  1016. }
  1017. }
  1018. foreach ($selectedObjectivesIds as $selectedObjectiveId) {
  1019. $returnObjectives[] = [
  1020. 'name' => $selectedObjectiveArrayById[$selectedObjectiveId]->title,
  1021. 'price' => $selectedObjectiveArrayById[$selectedObjectiveId]->price,
  1022. 'hour' => $selectedObjectivesHours->$selectedObjectiveId
  1023. ];
  1024. }
  1025. return $returnObjectives;
  1026. }
  1027. public function getPaymentString()
  1028. {
  1029. return Payment::TYPE[$this->getPaymentType()];
  1030. }
  1031. /**
  1032. * @return \DateTime
  1033. */
  1034. public function getPickUpDate()
  1035. {
  1036. return $this->pickUpDate;
  1037. }
  1038. public function setPickUpDate($pickUpDate)
  1039. {
  1040. $this->pickUpDate = $pickUpDate;
  1041. $this->updatePickUpDateTime();
  1042. }
  1043. public function updatePickUpDateTime()
  1044. {
  1045. $pickUpDateTime = $this->pickUpDateTime;
  1046. if (! $pickUpDateTime) {
  1047. $pickUpDateTime = new \DateTime();
  1048. if ($this->pickUpDate) {
  1049. $pickUpDateTime = clone($this->pickUpDate);
  1050. }
  1051. }
  1052. if ($this->pickUpDate) {
  1053. $pickUpDateTime->setDate(
  1054. $this->pickUpDate->format('Y'),
  1055. $this->pickUpDate->format('m'),
  1056. $this->pickUpDate->format('d')
  1057. );
  1058. }
  1059. if ($this->pickUpTime) {
  1060. $pickUpDateTime->setTime(
  1061. $this->pickUpTime->format('H'),
  1062. $this->pickUpTime->format('i')
  1063. );
  1064. }
  1065. $this->pickUpDateTime = clone($pickUpDateTime);
  1066. }
  1067. public function getPickUpFullDateTime()
  1068. {
  1069. $date = clone $this->getPickUpDate();
  1070. $pickUpTimeComponents = explode(':', $this->getPickUpTime());
  1071. $date->setTime($pickUpTimeComponents[0], $pickUpTimeComponents[1]);
  1072. return $date;
  1073. }
  1074. public function estimateEndDateTime()
  1075. {
  1076. $interval = $this->getEstimatedTime();
  1077. $intervalComponents = explode(':', $interval);
  1078. $minutes = intval($intervalComponents[0]) * 60 + intval($intervalComponents[1]);
  1079. $pickUp = clone $this->pickUpDateTime;
  1080. $pickUp->add(new \DateInterval('PT' . $minutes . 'M'));
  1081. return $pickUp;
  1082. }
  1083. public function estimateEndHourString()
  1084. {
  1085. return $this->estimateEndDateTime()->format('H:i');
  1086. }
  1087. /**
  1088. * @return CarType|null
  1089. */
  1090. public function getCarType()
  1091. {
  1092. return $this->carType;
  1093. }
  1094. /**
  1095. * @param CarType|null $carType
  1096. */
  1097. public function setCarType($carType)
  1098. {
  1099. $this->carType = $carType;
  1100. }
  1101. /**
  1102. * @return float
  1103. */
  1104. public function getDistanceUnit()
  1105. {
  1106. return $this->distanceUnit;
  1107. }
  1108. /**
  1109. * @param float $distanceUnit
  1110. */
  1111. public function setDistanceUnit($distanceUnit)
  1112. {
  1113. $this->distanceUnit = $distanceUnit;
  1114. }
  1115. /**
  1116. * @return string
  1117. */
  1118. public function getEstimatedTime()
  1119. {
  1120. return $this->estimatedTime;
  1121. }
  1122. /**
  1123. * @param string $estimatedTime
  1124. */
  1125. public function setEstimatedTime($estimatedTime)
  1126. {
  1127. $this->estimatedTime = $estimatedTime;
  1128. }
  1129. /**
  1130. * @param bool $seconds
  1131. * @return string
  1132. */
  1133. public function getEstimatedTimePrettyFormat($seconds = false) {
  1134. $prettyEstimatedTime = '0 minutes';
  1135. if (!empty($this->estimatedTime)) {
  1136. $eT = explode(":", $this->estimatedTime);
  1137. if (count($eT) === 3) {
  1138. $estimatedTime = "";
  1139. if (intval($eT[0]) > 0) {
  1140. $estimatedTime .= intval($eT[0]) . "h ";
  1141. }
  1142. if (intval($eT[1]) > 0) {
  1143. $estimatedTime .= intval($eT[1]) . "min ";
  1144. }
  1145. if (
  1146. ($seconds || empty($estimatedTime)) &&
  1147. intval($eT[2]) > 0
  1148. ) {
  1149. $estimatedTime .= intval($eT[2]) . "s";
  1150. }
  1151. if (!empty($estimatedTime)) {
  1152. $prettyEstimatedTime = $estimatedTime;
  1153. }
  1154. }
  1155. }
  1156. return $prettyEstimatedTime;
  1157. }
  1158. /**
  1159. * @return bool
  1160. */
  1161. public function isCreateAccount()
  1162. {
  1163. return $this->createAccount;
  1164. }
  1165. /**
  1166. * @param bool $createAccount
  1167. */
  1168. public function setCreateAccount($createAccount)
  1169. {
  1170. $this->createAccount = $createAccount;
  1171. }
  1172. /**
  1173. * @return BookingRequest|null
  1174. */
  1175. public function getReturnBooking()
  1176. {
  1177. return $this->returnBooking;
  1178. }
  1179. /**
  1180. * @param BookingRequest|null $returnBooking
  1181. */
  1182. public function setReturnBooking($returnBooking)
  1183. {
  1184. $this->returnBooking = $returnBooking;
  1185. }
  1186. public function __toString()
  1187. {
  1188. return $this->getId() ? (string) $this->getId() : 'n\a';
  1189. }
  1190. /**
  1191. * @return BookingRequest
  1192. */
  1193. public function getParentBooking()
  1194. {
  1195. return $this->parentBooking;
  1196. }
  1197. /**
  1198. * @param BookingRequest $parentBooking
  1199. */
  1200. public function setParentBooking($parentBooking)
  1201. {
  1202. $this->parentBooking = $parentBooking;
  1203. }
  1204. /**
  1205. * @return string
  1206. */
  1207. public function getPickUpPostCode()
  1208. {
  1209. return $this->pickUpPostCode;
  1210. }
  1211. /**
  1212. * @param string $pickUpPostCode
  1213. */
  1214. public function setPickUpPostCode($pickUpPostCode)
  1215. {
  1216. $this->pickUpPostCode = $pickUpPostCode;
  1217. }
  1218. /**
  1219. * @return string
  1220. */
  1221. public function getDestinationPostCode()
  1222. {
  1223. return $this->destinationPostCode;
  1224. }
  1225. /**
  1226. * @param string $destinationPostCode
  1227. */
  1228. public function setDestinationPostCode($destinationPostCode)
  1229. {
  1230. $this->destinationPostCode = $destinationPostCode;
  1231. }
  1232. /**
  1233. * @return string
  1234. */
  1235. public function getClientAlternativePhone()
  1236. {
  1237. return $this->clientAlternativePhone;
  1238. }
  1239. /**
  1240. * @param string $clientAlternativePhone
  1241. */
  1242. public function setClientAlternativePhone($clientAlternativePhone)
  1243. {
  1244. $this->clientAlternativePhone = $clientAlternativePhone;
  1245. }
  1246. /**
  1247. * @return string
  1248. */
  1249. public function getClientAlternativeEmail()
  1250. {
  1251. return $this->clientAlternativeEmail;
  1252. }
  1253. /**
  1254. * @param string $clientAlternativeEmail
  1255. */
  1256. public function setClientAlternativeEmail($clientAlternativeEmail)
  1257. {
  1258. $this->clientAlternativeEmail = $clientAlternativeEmail;
  1259. }
  1260. /**
  1261. * @return string
  1262. */
  1263. public function getVoucherCode()
  1264. {
  1265. return $this->voucherCode;
  1266. }
  1267. /**
  1268. * @param string $voucherCode
  1269. */
  1270. public function setVoucherCode($voucherCode)
  1271. {
  1272. $this->voucherCode = $voucherCode;
  1273. }
  1274. /**
  1275. * @return string
  1276. */
  1277. public function getVoucherValue()
  1278. {
  1279. return $this->voucherValue;
  1280. }
  1281. /**
  1282. * @param string $voucherValue
  1283. */
  1284. public function setVoucherValue($voucherValue)
  1285. {
  1286. $this->voucherValue = $voucherValue;
  1287. }
  1288. public function isCancel()
  1289. {
  1290. $cancelBooking = [
  1291. self::STATUS_DELETED,
  1292. self::STATUS_OFFICE_CANCELLATION,
  1293. self::STATUS_CANCELLED_OTHER_REASON,
  1294. self::STATUS_CLIENT_CANCELLATION
  1295. ];
  1296. if (in_array($this->status, $cancelBooking)) {
  1297. return true;
  1298. }
  1299. return false;
  1300. }
  1301. public function canBroadcast()
  1302. {
  1303. if ($this->getDriver()) {
  1304. return false;
  1305. }
  1306. return ! $this->isExpireBroadcast();
  1307. }
  1308. public function isExpireBroadcast()
  1309. {
  1310. if (! $this->expireBroadcastDate) {
  1311. return false;
  1312. }
  1313. $currentDate = new \DateTime();
  1314. if ($currentDate > $this->expireBroadcastDate) {
  1315. return false;
  1316. }
  1317. return true;
  1318. }
  1319. public function __clone() {
  1320. $this->id = null;
  1321. $this->pickUpDateTime = null;
  1322. $this->pickUpDate = null;
  1323. $this->pickUpTime = null;
  1324. }
  1325. public function formatAddressForListing($address)
  1326. {
  1327. $addressArray = explode(',', $address);
  1328. return [
  1329. array_slice($addressArray, 0, (count($addressArray)-2)),
  1330. array_slice($addressArray, -2)
  1331. ];
  1332. }
  1333. public function getMeetAndGreetTimePrettyFormat() {
  1334. if (!empty($this->getFlightLandingTime())) {
  1335. $pickUpTime = explode(":", $this->getPickUpTime());
  1336. $landingTime = explode(":", $this->getFlightLandingTime());
  1337. $date1 = new \DateTime();
  1338. $date2 = new \DateTime();
  1339. if ($landingTime[0] > $pickUpTime[0]) {
  1340. // the landing time & pick up Time is different day
  1341. // example: landing time 23:50, pick up time: 00:10
  1342. $date1->modify("+1 day");
  1343. }
  1344. $date1->setTime($pickUpTime[0], $pickUpTime[1]);
  1345. $date2->setTime($landingTime[0], $landingTime[1]);
  1346. $difference = date_diff($date1, $date2);
  1347. return ($difference->h ? $difference->h.'H' : '').
  1348. ($difference->i.'M');
  1349. }
  1350. return null;
  1351. }
  1352. /**
  1353. * Set pickUpLat
  1354. *
  1355. * @param float $pickUpLat
  1356. *
  1357. * @return BookingRequest
  1358. */
  1359. public function setPickUpLat($pickUpLat)
  1360. {
  1361. $this->pickUpLat = $pickUpLat;
  1362. return $this;
  1363. }
  1364. /**
  1365. * Get pickUpLat
  1366. *
  1367. * @return float
  1368. */
  1369. public function getPickUpLat()
  1370. {
  1371. return $this->pickUpLat;
  1372. }
  1373. /**
  1374. * Set pickUpLng
  1375. *
  1376. * @param float $pickUpLng
  1377. *
  1378. * @return BookingRequest
  1379. */
  1380. public function setPickUpLng($pickUpLng)
  1381. {
  1382. $this->pickUpLng = $pickUpLng;
  1383. return $this;
  1384. }
  1385. /**
  1386. * Get pickUpLng
  1387. *
  1388. * @return float
  1389. */
  1390. public function getPickUpLng()
  1391. {
  1392. return $this->pickUpLng;
  1393. }
  1394. /**
  1395. * Set destinationLat
  1396. *
  1397. * @param float $destinationLat
  1398. *
  1399. * @return BookingRequest
  1400. */
  1401. public function setDestinationLat($destinationLat)
  1402. {
  1403. $this->destinationLat = $destinationLat;
  1404. return $this;
  1405. }
  1406. /**
  1407. * Get destinationLat
  1408. *
  1409. * @return float
  1410. */
  1411. public function getDestinationLat()
  1412. {
  1413. return $this->destinationLat;
  1414. }
  1415. /**
  1416. * Set destinationLng
  1417. *
  1418. * @param float $destinationLng
  1419. *
  1420. * @return BookingRequest
  1421. */
  1422. public function setDestinationLng($destinationLng)
  1423. {
  1424. $this->destinationLng = $destinationLng;
  1425. return $this;
  1426. }
  1427. /**
  1428. * Get destinationLng
  1429. *
  1430. * @return float
  1431. */
  1432. public function getDestinationLng()
  1433. {
  1434. return $this->destinationLng;
  1435. }
  1436. public function getFullname()
  1437. {
  1438. return sprintf("%s %s", $this->getClientFirstName(), $this->getClientLastName());
  1439. }
  1440. public function getTotalCost()
  1441. {
  1442. return $this->getOverridePrice()?$this->overridePrice:$this->getQuotePrice();
  1443. }
  1444. public function getDriverNameAndInternal()
  1445. {
  1446. if(null!=$this->getDriver() && null!=$this->getDriver()->getUser()) {
  1447. return $this->getDriver()->getUser()->getFirstname() . ' ' . $this->getDriver()->getUser()->getLastname() . ' (' . $this->getDriver()->getInternalName() . ')';
  1448. }else{
  1449. return $this->getDriver();
  1450. }
  1451. }
  1452. public function getBookingDateFormated()
  1453. {
  1454. return $this->getBookingDate()->format('d/m/Y');
  1455. }
  1456. public function getBookingTimeFormated()
  1457. {
  1458. return $this->getBookingDate()->format('H:i');
  1459. }
  1460. public function getPickUpDateFormated()
  1461. {
  1462. return $this->getPickUpDate()->format('d/m/Y');
  1463. }
  1464. public function getTotalCostWithCurrency($currencySymbol = null)
  1465. {
  1466. if($currencySymbol == null){
  1467. $currencySymbol = chr(163);
  1468. }
  1469. return $currencySymbol.' '.$this->getTotalCost();
  1470. }
  1471. public function getStatusAsText()
  1472. {
  1473. return $this->getStringStatus($this->status);
  1474. }
  1475. /**
  1476. * @return string
  1477. */
  1478. public function getNotifiedDrivers()
  1479. {
  1480. return $this->notifiedDrivers;
  1481. }
  1482. /**
  1483. * @param string $notifiedDrivers
  1484. */
  1485. public function setNotifiedDrivers(string $notifiedDrivers): void
  1486. {
  1487. $this->notifiedDrivers = $notifiedDrivers;
  1488. }
  1489. /**
  1490. * @return string
  1491. */
  1492. public function getBookingCreatedKey()
  1493. {
  1494. return $this->bookingCreatedKey;
  1495. }
  1496. /**
  1497. * @param string $bookingCreatedKey
  1498. */
  1499. public function setBookingCreatedKey(string $bookingCreatedKey)
  1500. {
  1501. $this->bookingCreatedKey = $bookingCreatedKey;
  1502. }
  1503. /**
  1504. * @return float
  1505. */
  1506. public function getPmg()
  1507. {
  1508. return $this->pmg;
  1509. }
  1510. /**
  1511. * @param float $pmg
  1512. */
  1513. public function setPmg($pmg)
  1514. {
  1515. $this->pmg = $pmg;
  1516. }
  1517. /**
  1518. * @return float
  1519. */
  1520. public function getReturnPmg()
  1521. {
  1522. return $this->returnPmg;
  1523. }
  1524. /**
  1525. * @param float $returnPmg
  1526. */
  1527. public function setReturnPmg($returnPmg)
  1528. {
  1529. $this->returnPmg = $returnPmg;
  1530. }
  1531. /**
  1532. * @return string
  1533. */
  1534. public function getBookingDataSerialized()
  1535. {
  1536. return $this->bookingDataSerialized;
  1537. }
  1538. /**
  1539. * @param string $bookingDataSerialized
  1540. */
  1541. public function setBookingDataSerialized($bookingDataSerialized)
  1542. {
  1543. $this->bookingDataSerialized = $bookingDataSerialized;
  1544. }
  1545. public function getBookingDataSerializedDecoded()
  1546. {
  1547. return json_decode($this->bookingDataSerialized);
  1548. }
  1549. }