src/AdminBundle/Entity/Car.php line 837

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Symfony\Component\HttpFoundation\File\UploadedFile;
  6. /**
  7. * Car
  8. */
  9. #[ORM\Table(name: 'car')]
  10. #[ORM\Entity]
  11. #[ORM\HasLifecycleCallbacks]
  12. class Car extends BaseEntity
  13. {
  14. const CAR_TYPE_SALOON = 1;
  15. const CAR_TYPE_EXECUTIVE = 2;
  16. const CAR_TYPE_ESTATE = 3;
  17. const CAR_TYPE_MPV = 4;
  18. const CAR_TYPE_MVP5 = 5;
  19. const CAR_TYPE_MV6 = 6;
  20. const CAR_TYPE_MPV_EXECUTIVE = 7;
  21. const CAR_TYPE_MPV8 = 8;
  22. public static $carCtlfTypes = array(
  23. self::CAR_TYPE_SALOON => 'Saloon',
  24. self::CAR_TYPE_EXECUTIVE => 'Executive',
  25. self::CAR_TYPE_ESTATE => 'Estate',
  26. self::CAR_TYPE_MPV => 'MPV',
  27. self::CAR_TYPE_MVP5 => 'MPV5',
  28. self::CAR_TYPE_MV6 => 'MPV6',
  29. self::CAR_TYPE_MPV_EXECUTIVE => 'MPV Executive',
  30. self::CAR_TYPE_MPV8 => 'MPV8'
  31. );
  32. const CAR_STATUS_FREE= 1;
  33. const CAR_STATUS_ALOCATED = 2;
  34. const CAR_STATUS_OUT_OFF_DUTY = 3;
  35. public static $statusTypes = array(
  36. self::CAR_STATUS_FREE => 'Free',
  37. self::CAR_STATUS_ALOCATED => 'Alocated',
  38. self::CAR_STATUS_OUT_OFF_DUTY => 'Out off duty',
  39. );
  40. const VEHICLE_FILE_FOLDER = 'upload/vehicle/';
  41. const PHV_LICENSE_FILE_SETTER = 'setPhvLicenseFile';
  42. const LIMO_LICENSE_FILE_SETTER = 'setLimoLicenseForHire';
  43. const CAR_REGISTRATION_CERTIFICATE_FILE_SETTER = 'setCarRegistrationCertificate';
  44. const VEHICLE_INSPECTION_CERTIFICATE_FILE_SETTER = 'setVehicleInspectionCertificate';
  45. const V5LOG_BOOK_FILE_SETTER = 'setV5LogBookFile';
  46. const MOT_CHECK_FILE_SETTER = 'setMotCheckFile';
  47. const INSURANCE_FILE_SETTER = 'setInsuranceFile';
  48. const OTHER_DOCUMENT_SETTER = 'setOtherDocument';
  49. /**
  50. * @var integer
  51. */
  52. #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
  53. #[ORM\Id]
  54. #[ORM\GeneratedValue(strategy: 'IDENTITY')]
  55. protected $id;
  56. /**
  57. * @var string
  58. */
  59. #[ORM\Column(name: 'code', type: 'string', length: 64)]
  60. protected $code;
  61. /**
  62. * @var string
  63. */
  64. #[ORM\Column(name: 'maker', type: 'string')]
  65. protected $maker;
  66. /**
  67. * @var string
  68. */
  69. #[ORM\Column(name: 'model', type: 'string', length: 50)]
  70. protected $model;
  71. /**
  72. * @var string
  73. */
  74. #[ORM\Column(name: 'year', type: 'string', length: 4)]
  75. protected $year;
  76. /**
  77. * @var string
  78. */
  79. #[ORM\Column(name: 'color', type: 'string', length: 32)]
  80. protected $color;
  81. /**
  82. * @var string
  83. */
  84. #[ORM\Column(name: 'phone', type: 'string', length: 32)]
  85. protected $phone;
  86. /**
  87. * @var string
  88. */
  89. #[ORM\Column(name: 'registration_number', type: 'string', length: 64, nullable: true)]
  90. protected $registrationNumber;
  91. /**
  92. * @var string
  93. */
  94. #[ORM\Column(name: 'plate_number', type: 'string', length: 64)]
  95. protected $plateNumber;
  96. /**
  97. * @var \DateTime
  98. */
  99. #[ORM\Column(name: 'insurance_expiration_date', type: 'datetime', nullable: true)]
  100. protected $insuranceExpirationDate;
  101. /**
  102. * @var \DateTime
  103. */
  104. #[ORM\Column(name: 'register_date', type: 'datetime', nullable: true)]
  105. protected $registerDate;
  106. /**
  107. * @var \DateTime
  108. */
  109. #[ORM\Column(name: 'end_date', type: 'datetime', nullable: true)]
  110. protected $endDate;
  111. /**
  112. * @var \DateTime
  113. */
  114. #[ORM\Column(name: 'updated', type: 'datetime', nullable: true)]
  115. protected $updated;
  116. /**
  117. * @var \AdminBundle\Entity\CarType
  118. */
  119. #[ORM\JoinColumn(name: 'type', referencedColumnName: 'id')]
  120. #[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\CarType::class)]
  121. protected $type;
  122. /**
  123. * @var integer
  124. */
  125. #[ORM\Column(name: 'status', type: 'integer')]
  126. protected $status;
  127. /**
  128. * @var boolean
  129. */
  130. #[ORM\Column(name: 'child_extras', type: 'boolean')]
  131. protected $childExtras;
  132. /**
  133. * @var boolean
  134. */
  135. #[ORM\Column(name: 'disabled_access', type: 'boolean')]
  136. protected $disabledAccess;
  137. #[ORM\OneToMany(targetEntity: \Driver::class, mappedBy: 'car')]
  138. protected $drivers;
  139. /**
  140. * @var string
  141. */
  142. #[ORM\Column(name: 'phv_license_number', type: 'string', length: 64, nullable: true)]
  143. protected $phvLicenseNumber;
  144. /**
  145. * @var string
  146. */
  147. #[ORM\Column(name: 'limo_license_number', type: 'string', length: 64, nullable: true)]
  148. protected $limoLicenseNumber;
  149. /**
  150. * @var \DateTime
  151. */
  152. #[ORM\Column(name: 'phv_expire_date', type: 'date', nullable: true)]
  153. protected $phvExpireDate;
  154. /**
  155. * @var \DateTime
  156. */
  157. #[ORM\Column(name: 'limo_license_expiry_date', type: 'date', nullable: true)]
  158. protected $limoLicenseExpiryDate;
  159. /**
  160. * @var \DateTime
  161. */
  162. #[ORM\Column(name: 'mot_expiry_date', type: 'date', nullable: true)]
  163. protected $motExpiryDate;
  164. /**
  165. * @var \DateTime
  166. */
  167. #[ORM\Column(name: 'vehicle_inspection_expiry_date', type: 'date', nullable: true)]
  168. protected $vehicleInspectionExpiryDate;
  169. /**
  170. * @var string
  171. */
  172. #[ORM\Column(name: 'phv_license_file', type: 'string', length: 255, nullable: true)]
  173. protected $phvLicenseFile;
  174. /**
  175. * @var string
  176. */
  177. #[ORM\Column(name: 'v5log_book_file', type: 'string', length: 255, nullable: true)]
  178. protected $v5LogBookFile;
  179. /**
  180. * @var string
  181. */
  182. #[ORM\Column(name: 'mot_check_file', type: 'string', length: 255, nullable: true)]
  183. protected $motCheckFile;
  184. /**
  185. * @var string
  186. */
  187. #[ORM\Column(name: 'insurance_file', type: 'string', length: 255, nullable: true)]
  188. protected $insuranceFile;
  189. /**
  190. * @var string
  191. */
  192. #[ORM\Column(name: 'other_document', type: 'string', length: 255, nullable: true)]
  193. protected $otherDocument;
  194. /**
  195. * @var integer
  196. */
  197. #[ORM\Column(name: 'max_number_of_passengers', type: 'integer', nullable: true)]
  198. protected $maxNumberOfPassengers;
  199. /**
  200. * @var boolean
  201. */
  202. #[ORM\Column(name: 'pbia_permit', type: 'boolean', nullable: true)]
  203. protected $pbiaPermit = false;
  204. /**
  205. * @var boolean
  206. */
  207. #[ORM\Column(name: 'mia_ground_transportation_permit', type: 'boolean', nullable: true)]
  208. protected $miaGroundTransportationPermit = false;
  209. /**
  210. * @var boolean
  211. */
  212. #[ORM\Column(name: 'port_miami_permit', type: 'boolean', nullable: true)]
  213. protected $portMiamiPermit = false;
  214. /**
  215. * @var boolean
  216. */
  217. #[ORM\Column(name: 'broward_county_permit', type: 'boolean', nullable: true)]
  218. protected $browardCountyPermit = false;
  219. /**
  220. * @var \DateTime
  221. */
  222. #[ORM\Column(name: 'pbia_permit_expiration_date', type: 'date', nullable: true)]
  223. protected $pbiaPermitExpirationDate;
  224. /**
  225. * @var \DateTime
  226. */
  227. #[ORM\Column(name: 'mia_ground_transportation_permit_expiration_date', type: 'date', nullable: true)]
  228. protected $miaGroundTransportationPermitExpirationDate;
  229. /**
  230. * @var \DateTime
  231. */
  232. #[ORM\Column(name: 'port_miami_permit_expiration_date', type: 'date', nullable: true)]
  233. protected $portMiamiPermitExpirationDate;
  234. /**
  235. * @var \DateTime
  236. */
  237. #[ORM\Column(name: 'broward_county_permit_expiration_date', type: 'date', nullable: true)]
  238. protected $browardCountyPermitExpirationDate;
  239. /**
  240. * @var string
  241. */
  242. #[ORM\Column(name: 'limo_license_for_hire', type: 'string', length: 255, nullable: true)]
  243. protected $limoLicenseForHire;
  244. /**
  245. * @var string
  246. */
  247. #[ORM\Column(name: 'car_registration_certificate', type: 'string', length: 255, nullable: true)]
  248. protected $carRegistrationCertificate;
  249. /**
  250. * @var string
  251. */
  252. #[ORM\Column(name: 'vehicle_inspection_certificate', type: 'string', length: 255, nullable: true)]
  253. protected $vehicleInspectionCertificate;
  254. /**
  255. * @var \DateTime
  256. */
  257. #[ORM\Column(name: 'creation_date', type: 'date', nullable: true)]
  258. protected $creationDate;
  259. private $motCheckFileFile;
  260. private $phvLicenseFileFile;
  261. private $v5LogBookFileFile;
  262. private $insuranceFileFile;
  263. private $otherDocumentFile;
  264. private $limoLicenseForHireFile;
  265. private $carRegistrationCertificateFile;
  266. private $vehicleInspectionCertificateFile;
  267. public function __construct()
  268. {
  269. $this->drivers = new ArrayCollection();
  270. $this->creationDate = new \DateTime();
  271. }
  272. /**
  273. * @return int
  274. */
  275. public function getId()
  276. {
  277. return $this->id;
  278. }
  279. /**
  280. * @param int $id
  281. */
  282. public function setId($id)
  283. {
  284. $this->id = $id;
  285. }
  286. /**
  287. * @return int
  288. */
  289. public function getStatus()
  290. {
  291. return $this->status;
  292. }
  293. /**
  294. * @param int $status
  295. */
  296. public function setStatus($status)
  297. {
  298. $this->status = $status;
  299. }
  300. /**
  301. * @return CarType
  302. */
  303. public function getType()
  304. {
  305. return $this->type;
  306. }
  307. /**
  308. * @param CarType $type
  309. */
  310. public function setType($type)
  311. {
  312. $this->type = $type;
  313. }
  314. /**
  315. * @return string
  316. */
  317. public function getPlateNumber()
  318. {
  319. return $this->plateNumber;
  320. }
  321. /**
  322. * @param string $plateNumber
  323. */
  324. public function setPlateNumber($plateNumber)
  325. {
  326. $this->plateNumber = $plateNumber;
  327. }
  328. /**
  329. * @return string
  330. */
  331. public function getRegistrationNumber()
  332. {
  333. return $this->registrationNumber;
  334. }
  335. /**
  336. * @param string $registrationNumber
  337. */
  338. public function setRegistrationNumber($registrationNumber)
  339. {
  340. $this->registrationNumber = $registrationNumber;
  341. }
  342. /**
  343. * @return string
  344. */
  345. public function getPhone()
  346. {
  347. return $this->phone;
  348. }
  349. /**
  350. * @param string $phone
  351. */
  352. public function setPhone($phone)
  353. {
  354. $this->phone = $phone;
  355. }
  356. /**
  357. * @return string
  358. */
  359. public function getColor()
  360. {
  361. return $this->color;
  362. }
  363. /**
  364. * @param string $color
  365. */
  366. public function setColor($color)
  367. {
  368. $this->color = $color;
  369. }
  370. /**
  371. * @return string
  372. */
  373. public function getYear()
  374. {
  375. return $this->year;
  376. }
  377. /**
  378. * @param string $year
  379. */
  380. public function setYear($year)
  381. {
  382. $this->year = $year;
  383. }
  384. /**
  385. * @return string
  386. */
  387. public function getModel()
  388. {
  389. return $this->model;
  390. }
  391. /**
  392. * @param string $model
  393. */
  394. public function setModel($model)
  395. {
  396. $this->model = $model;
  397. }
  398. /**
  399. * @return int
  400. */
  401. public function getMaker()
  402. {
  403. return $this->maker;
  404. }
  405. /**
  406. * @param int $maker
  407. */
  408. public function setMaker($maker)
  409. {
  410. $this->maker = $maker;
  411. }
  412. /**
  413. * @return string
  414. */
  415. public function getCode()
  416. {
  417. return $this->code;
  418. }
  419. /**
  420. * @param string $code
  421. */
  422. public function setCode($code)
  423. {
  424. $this->code = $code;
  425. }
  426. /**
  427. * @return boolean
  428. */
  429. public function isChildExtras()
  430. {
  431. return $this->childExtras;
  432. }
  433. /**
  434. * @param boolean $childExtras
  435. */
  436. public function setChildExtras($childExtras)
  437. {
  438. $this->childExtras = $childExtras;
  439. }
  440. /**
  441. * @return mixed
  442. */
  443. public function getDisabledAccess()
  444. {
  445. return $this->disabledAccess;
  446. }
  447. /**
  448. * @param mixed $disabledAccess
  449. */
  450. public function setDisabledAccess($disabledAccess)
  451. {
  452. $this->disabledAccess = $disabledAccess;
  453. }
  454. /**
  455. * @param int $everyExtraDistanceCost
  456. */
  457. public function setEveryExtraDistanceCost($everyExtraDistanceCost)
  458. {
  459. $this->everyExtraDistanceCost = $everyExtraDistanceCost;
  460. }
  461. public function getDrivers()
  462. {
  463. return $this->drivers;
  464. }
  465. public function addDriver(Driver $driver)
  466. {
  467. $this->drivers->add($driver);
  468. }
  469. /**
  470. * @return string
  471. */
  472. public function getPhvLicenseNumber()
  473. {
  474. return $this->phvLicenseNumber;
  475. }
  476. /**
  477. * @param string $phvLicenseNumber
  478. */
  479. public function setPhvLicenseNumber($phvLicenseNumber)
  480. {
  481. $this->phvLicenseNumber = $phvLicenseNumber;
  482. }
  483. /**
  484. * @return \DateTime
  485. */
  486. public function getPhvExpireDate()
  487. {
  488. return $this->phvExpireDate;
  489. }
  490. /**
  491. * @param \DateTime $phvExpireDate
  492. */
  493. public function setPhvExpireDate($phvExpireDate)
  494. {
  495. $this->phvExpireDate = $phvExpireDate;
  496. }
  497. /**
  498. * @return \DateTime
  499. */
  500. public function getMotExpiryDate()
  501. {
  502. return $this->motExpiryDate;
  503. }
  504. /**
  505. * @param \DateTime $motExpiryDate
  506. */
  507. public function setMotExpiryDate($motExpiryDate)
  508. {
  509. $this->motExpiryDate = $motExpiryDate;
  510. }
  511. public function __toString()
  512. {
  513. return $this->getCode(). ' '. $this->getMaker() ? $this->getCode(). ' '. $this->getMaker() : 'n\a';
  514. }
  515. /**
  516. * @return \DateTime
  517. */
  518. public function getInsuranceExpirationDate()
  519. {
  520. return $this->insuranceExpirationDate;
  521. }
  522. /**
  523. * @param \DateTime $insuranceExpirationDate
  524. */
  525. public function setInsuranceExpirationDate($insuranceExpirationDate)
  526. {
  527. $this->insuranceExpirationDate = $insuranceExpirationDate;
  528. }
  529. /**
  530. * @return \DateTime
  531. */
  532. public function getRegisterDate()
  533. {
  534. return $this->registerDate;
  535. }
  536. /**
  537. * @param \DateTime $registerDate
  538. */
  539. public function setRegisterDate($registerDate)
  540. {
  541. $this->registerDate = $registerDate;
  542. }
  543. /**
  544. * @return \DateTime
  545. */
  546. public function getEndDate()
  547. {
  548. return $this->endDate;
  549. }
  550. /**
  551. * @param \DateTime $endDate
  552. */
  553. public function setEndDate($endDate)
  554. {
  555. $this->endDate = $endDate;
  556. }
  557. /**
  558. * @return string
  559. */
  560. public function getPhvLicenseFile()
  561. {
  562. return $this->phvLicenseFile;
  563. }
  564. /**
  565. * @param string $phvLicenseFile
  566. */
  567. public function setPhvLicenseFile($phvLicenseFile)
  568. {
  569. $this->phvLicenseFile = $phvLicenseFile;
  570. }
  571. /**
  572. * @return string
  573. */
  574. public function getV5LogBookFile()
  575. {
  576. return $this->v5LogBookFile;
  577. }
  578. /**
  579. * @param string $v5LogBookFile
  580. */
  581. public function setV5LogBookFile($v5LogBookFile)
  582. {
  583. $this->v5LogBookFile = $v5LogBookFile;
  584. }
  585. /**
  586. * @return string
  587. */
  588. public function getMotCheckFile()
  589. {
  590. return $this->motCheckFile;
  591. }
  592. /**
  593. * @param string $motCheckFile
  594. */
  595. public function setMotCheckFile($motCheckFile)
  596. {
  597. $this->motCheckFile = $motCheckFile;
  598. }
  599. /**
  600. * @return string
  601. */
  602. public function getInsuranceFile()
  603. {
  604. return $this->insuranceFile;
  605. }
  606. /**
  607. * @param string $insuranceFile
  608. */
  609. public function setInsuranceFile($insuranceFile)
  610. {
  611. $this->insuranceFile = $insuranceFile;
  612. }
  613. /**
  614. * @return string
  615. */
  616. public function getOtherDocument()
  617. {
  618. return $this->otherDocument;
  619. }
  620. /**
  621. * @param string $otherDocument
  622. */
  623. public function setOtherDocument($otherDocument)
  624. {
  625. $this->otherDocument = $otherDocument;
  626. }
  627. /**
  628. * @return string
  629. */
  630. public function getCarRegistrationCertificate()
  631. {
  632. return $this->carRegistrationCertificate;
  633. }
  634. /**
  635. * @param string $carRegistrationCertificate
  636. */
  637. public function setCarRegistrationCertificate($carRegistrationCertificate)
  638. {
  639. $this->carRegistrationCertificate = $carRegistrationCertificate;
  640. }
  641. /**
  642. * @return string
  643. */
  644. public function getVehicleInspectionCertificate()
  645. {
  646. return $this->vehicleInspectionCertificate;
  647. }
  648. /**
  649. * @param string $vehicleInspectionCertificate
  650. */
  651. public function setVehicleInspectionCertificate($vehicleInspectionCertificate)
  652. {
  653. $this->vehicleInspectionCertificate = $vehicleInspectionCertificate;
  654. }
  655. /**
  656. * @return string
  657. */
  658. public function getLimoLicenseForHire()
  659. {
  660. return $this->limoLicenseForHire;
  661. }
  662. /**
  663. * @param string $limoLicenseForHire
  664. */
  665. public function setLimoLicenseForHire($limoLicenseForHire)
  666. {
  667. $this->limoLicenseForHire = $limoLicenseForHire;
  668. }
  669. public function getUploadFilePath()
  670. {
  671. if (!is_dir(self::VEHICLE_FILE_FOLDER.$this->id)) {
  672. mkdir(self::VEHICLE_FILE_FOLDER.$this->id, 0777, true);
  673. }
  674. return self::VEHICLE_FILE_FOLDER.$this->id.'/';
  675. }
  676. /**
  677. * @param UploadedFile $phvLicenseFileFile
  678. */
  679. public function setPhvLicenseFileFile(UploadedFile $phvLicenseFileFile = null)
  680. {
  681. $this->phvLicenseFileFile = $phvLicenseFileFile;
  682. }
  683. /**
  684. * @param UploadedFile $v5LogBookFileFile
  685. */
  686. public function setV5LogBookFileFile(UploadedFile $v5LogBookFileFile = null)
  687. {
  688. $this->v5LogBookFileFile = $v5LogBookFileFile;
  689. }
  690. /**
  691. * @param UploadedFile $motCheckFileFile
  692. */
  693. public function setMotCheckFileFile(UploadedFile $motCheckFileFile = null)
  694. {
  695. $this->motCheckFileFile = $motCheckFileFile;
  696. }
  697. /**
  698. * @param UploadedFile $insuranceFileFile
  699. */
  700. public function setInsuranceFileFile(UploadedFile $insuranceFileFile = null)
  701. {
  702. $this->insuranceFileFile = $insuranceFileFile;
  703. }
  704. /**
  705. * @param UploadedFile $otherDocumentFile
  706. */
  707. public function setOtherDocumentFile(UploadedFile $otherDocumentFile = null)
  708. {
  709. $this->otherDocumentFile = $otherDocumentFile;
  710. }
  711. /**
  712. * @param UploadedFile $limoLicenseForHireFile
  713. */
  714. public function setLimoLicenseForHireFile(UploadedFile $limoLicenseForHireFile = null)
  715. {
  716. $this->limoLicenseForHireFile = $limoLicenseForHireFile;
  717. }
  718. /**
  719. * @param UploadedFile $carRegistrationCertificateFile
  720. */
  721. public function setCarRegistrationCertificateFile(UploadedFile $carRegistrationCertificateFile = null)
  722. {
  723. $this->carRegistrationCertificateFile = $carRegistrationCertificateFile;
  724. }
  725. /**
  726. * @param UploadedFile $vehicleInspectionCertificateFile
  727. */
  728. public function setVehicleInspectionCertificateFile(UploadedFile $vehicleInspectionCertificateFile = null)
  729. {
  730. $this->vehicleInspectionCertificateFile = $vehicleInspectionCertificateFile;
  731. }
  732. public function setUpdated($updated)
  733. {
  734. $this->updated = $updated;
  735. }
  736. public function getUpdated()
  737. {
  738. return $this->updated;
  739. }
  740. public function refreshUpdated()
  741. {
  742. $this->setUpdated(new \DateTime());
  743. }
  744. /**
  745. * @return int
  746. */
  747. public function getMaxNumberOfPassengers()
  748. {
  749. return $this->maxNumberOfPassengers;
  750. }
  751. /**
  752. * @param int $maxNumberOfPassengers
  753. */
  754. public function setMaxNumberOfPassengers($maxNumberOfPassengers)
  755. {
  756. $this->maxNumberOfPassengers = $maxNumberOfPassengers;
  757. }
  758. /**
  759. * @return UploadedFile
  760. */
  761. public function getPhvLicenseFileFile()
  762. {
  763. return $this->phvLicenseFileFile;
  764. }
  765. /**
  766. * @return UploadedFile
  767. */
  768. public function getV5LogBookFileFile()
  769. {
  770. return $this->v5LogBookFileFile;
  771. }
  772. /**
  773. * @return UploadedFile
  774. */
  775. public function getMotCheckFileFile()
  776. {
  777. return $this->motCheckFileFile;
  778. }
  779. /**
  780. * @return UploadedFile
  781. */
  782. public function getInsuranceFileFile()
  783. {
  784. return $this->insuranceFileFile;
  785. }
  786. /**
  787. * @return UploadedFile
  788. */
  789. public function getOtherDocumentFile()
  790. {
  791. return $this->otherDocumentFile;
  792. }
  793. /**
  794. * @return UploadedFile
  795. */
  796. public function getVehicleInspectionCertificateFile()
  797. {
  798. return $this->vehicleInspectionCertificateFile;
  799. }
  800. /**
  801. * @return UploadedFile
  802. */
  803. public function getLimoLicenseForHireFile()
  804. {
  805. return $this->limoLicenseForHireFile;
  806. }
  807. /**
  808. * @return UploadedFile
  809. */
  810. public function getCarRegistrationCertificateFile()
  811. {
  812. return $this->carRegistrationCertificateFile;
  813. }
  814. public function getPhvLicenseFilePath()
  815. {
  816. if (!$this->phvLicenseFile) {
  817. return ;
  818. }
  819. return $this->getUploadFilePath() . $this->phvLicenseFile;
  820. }
  821. public function getV5LogBookFilePath()
  822. {
  823. if (!$this->v5LogBookFile) {
  824. return ;
  825. }
  826. return $this->getUploadFilePath() . $this->v5LogBookFile;
  827. }
  828. public function getMotCheckFilePath()
  829. {
  830. if (!$this->motCheckFile) {
  831. return ;
  832. }
  833. return $this->getUploadFilePath() . $this->motCheckFile;
  834. }
  835. public function getInsuranceFilePath()
  836. {
  837. if (!$this->insuranceFile) {
  838. return ;
  839. }
  840. return $this->getUploadFilePath() . $this->insuranceFile;
  841. }
  842. public function getOtherDocumentFilePath()
  843. {
  844. if (!$this->otherDocument) {
  845. return ;
  846. }
  847. return $this->getUploadFilePath() . $this->otherDocument;
  848. }
  849. public function getCarRegistrationCertificateFilePath()
  850. {
  851. if (!$this->carRegistrationCertificate) {
  852. return ;
  853. }
  854. return $this->getUploadFilePath() . $this->carRegistrationCertificate;
  855. }
  856. public function getLimoLicenseForHireFilePath()
  857. {
  858. if (!$this->limoLicenseForHire) {
  859. return ;
  860. }
  861. return $this->getUploadFilePath() . $this->limoLicenseForHire;
  862. }
  863. public function getVehicleInspectionCertificateFilePath()
  864. {
  865. if (!$this->vehicleInspectionCertificate) {
  866. return ;
  867. }
  868. return $this->getUploadFilePath() . $this->vehicleInspectionCertificate;
  869. }
  870. public function uploadCarRegistrationCertificate()
  871. {
  872. if (null === $this->getCarRegistrationCertificateFile()) {
  873. return;
  874. }
  875. $this->removeCarRegistrationCertificateFile();
  876. $nDate= new \DateTime();
  877. $filename = 'CAR_REGISTRATION_CERTIFICATE_'.$nDate->format('Y-m-d');
  878. $this->carRegistrationCertificate = $filename.'.'.$this->getCarRegistrationCertificateFile()->guessExtension();
  879. $this->getCarRegistrationCertificateFile()->move(
  880. $this->getUploadFilePath(),
  881. $this->carRegistrationCertificate
  882. );
  883. $this->setCarRegistrationCertificateFile(null);
  884. }
  885. public function uploadVehicleInspectionCertificate()
  886. {
  887. if (null === $this->getVehicleInspectionCertificateFile()) {
  888. return;
  889. }
  890. $this->removeVehicleInspectionCertificateFile();
  891. $nDate= new \DateTime();
  892. $filename = 'VEHICLE_INSPECTION_CERTIFICATE_'.$nDate->format('Y-m-d');
  893. $this->vehicleInspectionCertificate = $filename.'.'.$this->getVehicleInspectionCertificateFile()->guessExtension();
  894. $this->getVehicleInspectionCertificateFile()->move(
  895. $this->getUploadFilePath(),
  896. $this->vehicleInspectionCertificate
  897. );
  898. $this->setVehicleInspectionCertificateFile(null);
  899. }
  900. public function uploadLimoLicenseForHire()
  901. {
  902. if (null === $this->getLimoLicenseForHireFile()) {
  903. return;
  904. }
  905. $this->removeLimoLicenseForHireFile();
  906. $nDate= new \DateTime();
  907. $filename = 'LIMO_LICENSE_FOR_HIRE_'.$nDate->format('Y-m-d');
  908. $this->limoLicenseForHire = $filename.'.'.$this->getLimoLicenseForHireFile()->guessExtension();
  909. $this->getLimoLicenseForHireFile()->move(
  910. $this->getUploadFilePath(),
  911. $this->limoLicenseForHire
  912. );
  913. $this->setLimoLicenseForHireFile(null);
  914. }
  915. public function uploadPhvLicenseFile()
  916. {
  917. if (null === $this->getPhvLicenseFileFile()) {
  918. return;
  919. }
  920. $this->removePhvLicenseFileFile();
  921. $nDate= new \DateTime();
  922. $filename = 'VEHICLE_PHV_LICENSE_'.$nDate->format('Y-m-d');
  923. $this->phvLicenseFile = $filename.'.'.$this->getPhvLicenseFileFile()->guessExtension();
  924. $this->getPhvLicenseFileFile()->move(
  925. $this->getUploadFilePath(),
  926. $this->phvLicenseFile
  927. );
  928. $this->setPhvLicenseFileFile(null);
  929. }
  930. public function uploadV5LogBookFile()
  931. {
  932. if (null === $this->getV5LogBookFileFile()) {
  933. return;
  934. }
  935. $this->removeV5LogBookFileFile();
  936. $nDate= new \DateTime();
  937. $filename = 'VEHICLE_V5LOG_BOOK_'.$nDate->format('Y-m-d');
  938. $this->v5LogBookFile = $filename.'.'.$this->getV5LogBookFileFile()->guessExtension();
  939. $this->getV5LogBookFileFile()->move(
  940. $this->getUploadFilePath(),
  941. $this->v5LogBookFile
  942. );
  943. $this->setV5LogBookFileFile(null);
  944. }
  945. public function uploadMotCheckFile()
  946. {
  947. if (null === $this->getMotCheckFileFile()) {
  948. return;
  949. }
  950. $this->removeMotCheckFileFile();
  951. $nDate= new \DateTime();
  952. $filename = 'VEHICLE_MOT_CHECK_'.$nDate->format('Y-m-d');
  953. $this->motCheckFile = $filename.'.'.$this->getMotCheckFileFile()->guessExtension();
  954. $this->getMotCheckFileFile()->move(
  955. $this->getUploadFilePath(),
  956. $this->motCheckFile
  957. );
  958. $this->setMotCheckFileFile(null);
  959. }
  960. public function uploadInsuranceFile()
  961. {
  962. if (null === $this->getInsuranceFileFile()) {
  963. return;
  964. }
  965. $this->removeInsuranceFileFile();
  966. $nDate= new \DateTime();
  967. $filename = 'VEHICLE_INSURANCE_'.$nDate->format('Y-m-d');
  968. $this->insuranceFile = $filename.'.'.$this->getInsuranceFileFile()->guessExtension();
  969. $this->getInsuranceFileFile()->move(
  970. $this->getUploadFilePath(),
  971. $this->insuranceFile
  972. );
  973. $this->setInsuranceFileFile(null);
  974. }
  975. public function uploadOtherDocumentFile()
  976. {
  977. if (null === $this->getOtherDocumentFile()) {
  978. return;
  979. }
  980. $this->removeOtherDocumentFile();
  981. $nDate= new \DateTime();
  982. $filename = 'VEHICLE_OTHER_DOCUMENT_'.$nDate->format('Y-m-d');
  983. $this->otherDocument = $filename.'.'.$this->getOtherDocumentFile()->guessExtension();
  984. $this->getOtherDocumentFile()->move(
  985. $this->getUploadFilePath(),
  986. $this->otherDocument
  987. );
  988. $this->setOtherDocumentFile(null);
  989. }
  990. #[ORM\PreUpdate]
  991. #[ORM\PrePersist]
  992. public function lifecycleFileUpload()
  993. {
  994. $this->uploadLimoLicenseForHire();
  995. $this->uploadVehicleInspectionCertificate();
  996. $this->uploadCarRegistrationCertificate();
  997. $this->uploadPhvLicenseFile();
  998. $this->uploadV5LogBookFile();
  999. $this->uploadInsuranceFile();
  1000. $this->uploadMotCheckFile();
  1001. $this->uploadOtherDocumentFile();
  1002. }
  1003. #[ORM\PostRemove]
  1004. public function removeUpload()
  1005. {
  1006. $this->removeLimoLicenseForHireFile();
  1007. $this->removeVehicleInspectionCertificateFile();
  1008. $this->removeCarRegistrationCertificateFile();
  1009. $this->removePhvLicenseFileFile();
  1010. $this->removeV5LogBookFileFile();
  1011. $this->removeOtherDocumentFile();
  1012. $this->removeInsuranceFileFile();
  1013. $this->removeMotCheckFileFile();
  1014. }
  1015. public function removeLimoLicenseForHireFile()
  1016. {
  1017. if ($limoLicenseForHireFile = $this->getLimoLicenseForHireFilePath()) {
  1018. @unlink($limoLicenseForHireFile);
  1019. }
  1020. }
  1021. public function removeCarRegistrationCertificateFile()
  1022. {
  1023. if ($carRegistrationCertificateFile = $this->getCarRegistrationCertificateFilePath()) {
  1024. @unlink($carRegistrationCertificateFile);
  1025. }
  1026. }
  1027. public function removeVehicleInspectionCertificateFile()
  1028. {
  1029. if ($vehicleInspectionCertificateFile = $this->getVehicleInspectionCertificateFilePath()) {
  1030. @unlink($vehicleInspectionCertificateFile);
  1031. }
  1032. }
  1033. public function removePhvLicenseFileFile()
  1034. {
  1035. if ($phvLicenseFileFile = $this->getPhvLicenseFilePath()) {
  1036. @unlink($phvLicenseFileFile);
  1037. }
  1038. }
  1039. public function removeV5LogBookFileFile()
  1040. {
  1041. if ($v5LogBookFileFile = $this->getV5LogBookFilePath()) {
  1042. @unlink($v5LogBookFileFile);
  1043. }
  1044. }
  1045. public function removeMotCheckFileFile()
  1046. {
  1047. if ($motCheckFileFile = $this->getMotCheckFilePath()) {
  1048. @unlink($motCheckFileFile);
  1049. }
  1050. }
  1051. public function removeInsuranceFileFile()
  1052. {
  1053. if ($insuranceFileFile = $this->getInsuranceFilePath()) {
  1054. @unlink($insuranceFileFile);
  1055. }
  1056. }
  1057. public function removeOtherDocumentFile()
  1058. {
  1059. if ($otherDocumentFile = $this->getOtherDocumentFilePath()) {
  1060. @unlink($otherDocumentFile);
  1061. }
  1062. }
  1063. /**
  1064. * @return string
  1065. */
  1066. public function getLimoLicenseNumber()
  1067. {
  1068. return $this->limoLicenseNumber;
  1069. }
  1070. /**
  1071. * @param string $limoLicenseNumber
  1072. */
  1073. public function setLimoLicenseNumber($limoLicenseNumber)
  1074. {
  1075. $this->limoLicenseNumber = $limoLicenseNumber;
  1076. }
  1077. /**
  1078. * @return \DateTime
  1079. */
  1080. public function getLimoLicenseExpiryDate()
  1081. {
  1082. return $this->limoLicenseExpiryDate;
  1083. }
  1084. /**
  1085. * @param \DateTime $limoLicenseExpiryDate
  1086. */
  1087. public function setLimoLicenseExpiryDate($limoLicenseExpiryDate)
  1088. {
  1089. $this->limoLicenseExpiryDate = $limoLicenseExpiryDate;
  1090. }
  1091. /**
  1092. * @return \DateTime
  1093. */
  1094. public function getVehicleInspectionExpiryDate()
  1095. {
  1096. return $this->vehicleInspectionExpiryDate;
  1097. }
  1098. /**
  1099. * @param \DateTime $vehicleInspectionExpiryDate
  1100. */
  1101. public function setVehicleInspectionExpiryDate($vehicleInspectionExpiryDate)
  1102. {
  1103. $this->vehicleInspectionExpiryDate = $vehicleInspectionExpiryDate;
  1104. }
  1105. /**
  1106. * @return bool
  1107. */
  1108. public function isPbiaPermit()
  1109. {
  1110. return $this->pbiaPermit;
  1111. }
  1112. /**
  1113. * @param bool $pbiaPermit
  1114. */
  1115. public function setPbiaPermit($pbiaPermit)
  1116. {
  1117. $this->pbiaPermit = $pbiaPermit;
  1118. }
  1119. /**
  1120. * @return bool
  1121. */
  1122. public function isMiaGroundTransportationPermit()
  1123. {
  1124. return $this->miaGroundTransportationPermit;
  1125. }
  1126. /**
  1127. * @param bool $miaGroundTransportationPermit
  1128. */
  1129. public function setMiaGroundTransportationPermit($miaGroundTransportationPermit)
  1130. {
  1131. $this->miaGroundTransportationPermit = $miaGroundTransportationPermit;
  1132. }
  1133. /**
  1134. * @return bool
  1135. */
  1136. public function isPortMiamiPermit()
  1137. {
  1138. return $this->portMiamiPermit;
  1139. }
  1140. /**
  1141. * @param bool $portMiamiPermit
  1142. */
  1143. public function setPortMiamiPermit($portMiamiPermit)
  1144. {
  1145. $this->portMiamiPermit = $portMiamiPermit;
  1146. }
  1147. /**
  1148. * @return bool
  1149. */
  1150. public function isBrowardCountyPermit()
  1151. {
  1152. return $this->browardCountyPermit;
  1153. }
  1154. /**
  1155. * @param bool $browardCountyPermit
  1156. */
  1157. public function setBrowardCountyPermit($browardCountyPermit)
  1158. {
  1159. $this->browardCountyPermit = $browardCountyPermit;
  1160. }
  1161. /**
  1162. * @return \DateTime
  1163. */
  1164. public function getPbiaPermitExpirationDate()
  1165. {
  1166. return $this->pbiaPermitExpirationDate;
  1167. }
  1168. /**
  1169. * @param \DateTime $pbiaPermitExpirationDate
  1170. */
  1171. public function setPbiaPermitExpirationDate($pbiaPermitExpirationDate)
  1172. {
  1173. $this->pbiaPermitExpirationDate = $pbiaPermitExpirationDate;
  1174. }
  1175. /**
  1176. * @return \DateTime
  1177. */
  1178. public function getMiaGroundTransportationPermitExpirationDate()
  1179. {
  1180. return $this->miaGroundTransportationPermitExpirationDate;
  1181. }
  1182. /**
  1183. * @param \DateTime $miaGroundTransportationPermitExpirationDate
  1184. */
  1185. public function setMiaGroundTransportationPermitExpirationDate($miaGroundTransportationPermitExpirationDate)
  1186. {
  1187. $this->miaGroundTransportationPermitExpirationDate = $miaGroundTransportationPermitExpirationDate;
  1188. }
  1189. /**
  1190. * @return \DateTime
  1191. */
  1192. public function getPortMiamiPermitExpirationDate()
  1193. {
  1194. return $this->portMiamiPermitExpirationDate;
  1195. }
  1196. /**
  1197. * @param \DateTime $portMiamiPermitExpirationDate
  1198. */
  1199. public function setPortMiamiPermitExpirationDate($portMiamiPermitExpirationDate)
  1200. {
  1201. $this->portMiamiPermitExpirationDate = $portMiamiPermitExpirationDate;
  1202. }
  1203. /**
  1204. * @return \DateTime
  1205. */
  1206. public function getBrowardCountyPermitExpirationDate()
  1207. {
  1208. return $this->browardCountyPermitExpirationDate;
  1209. }
  1210. /**
  1211. * @param \DateTime $browardCountyPermitExpirationDate
  1212. */
  1213. public function setBrowardCountyPermitExpirationDate($browardCountyPermitExpirationDate)
  1214. {
  1215. $this->browardCountyPermitExpirationDate = $browardCountyPermitExpirationDate;
  1216. }
  1217. /**
  1218. * @return \DateTime
  1219. */
  1220. public function getCreationDate()
  1221. {
  1222. return $this->creationDate;
  1223. }
  1224. /**
  1225. * @param \DateTime $creationDate
  1226. */
  1227. public function setCreationDate($creationDate)
  1228. {
  1229. $this->creationDate = $creationDate;
  1230. }
  1231. }