<?php
namespace AdminBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Car
*/
#[ORM\Table(name: 'car')]
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
class Car extends BaseEntity
{
const CAR_TYPE_SALOON = 1;
const CAR_TYPE_EXECUTIVE = 2;
const CAR_TYPE_ESTATE = 3;
const CAR_TYPE_MPV = 4;
const CAR_TYPE_MVP5 = 5;
const CAR_TYPE_MV6 = 6;
const CAR_TYPE_MPV_EXECUTIVE = 7;
const CAR_TYPE_MPV8 = 8;
public static $carCtlfTypes = array(
self::CAR_TYPE_SALOON => 'Saloon',
self::CAR_TYPE_EXECUTIVE => 'Executive',
self::CAR_TYPE_ESTATE => 'Estate',
self::CAR_TYPE_MPV => 'MPV',
self::CAR_TYPE_MVP5 => 'MPV5',
self::CAR_TYPE_MV6 => 'MPV6',
self::CAR_TYPE_MPV_EXECUTIVE => 'MPV Executive',
self::CAR_TYPE_MPV8 => 'MPV8'
);
const CAR_STATUS_FREE= 1;
const CAR_STATUS_ALOCATED = 2;
const CAR_STATUS_OUT_OFF_DUTY = 3;
public static $statusTypes = array(
self::CAR_STATUS_FREE => 'Free',
self::CAR_STATUS_ALOCATED => 'Alocated',
self::CAR_STATUS_OUT_OFF_DUTY => 'Out off duty',
);
const VEHICLE_FILE_FOLDER = 'upload/vehicle/';
const PHV_LICENSE_FILE_SETTER = 'setPhvLicenseFile';
const LIMO_LICENSE_FILE_SETTER = 'setLimoLicenseForHire';
const CAR_REGISTRATION_CERTIFICATE_FILE_SETTER = 'setCarRegistrationCertificate';
const VEHICLE_INSPECTION_CERTIFICATE_FILE_SETTER = 'setVehicleInspectionCertificate';
const V5LOG_BOOK_FILE_SETTER = 'setV5LogBookFile';
const MOT_CHECK_FILE_SETTER = 'setMotCheckFile';
const INSURANCE_FILE_SETTER = 'setInsuranceFile';
const OTHER_DOCUMENT_SETTER = 'setOtherDocument';
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
protected $id;
/**
* @var string
*/
#[ORM\Column(name: 'code', type: 'string', length: 64)]
protected $code;
/**
* @var string
*/
#[ORM\Column(name: 'maker', type: 'string')]
protected $maker;
/**
* @var string
*/
#[ORM\Column(name: 'model', type: 'string', length: 50)]
protected $model;
/**
* @var string
*/
#[ORM\Column(name: 'year', type: 'string', length: 4)]
protected $year;
/**
* @var string
*/
#[ORM\Column(name: 'color', type: 'string', length: 32)]
protected $color;
/**
* @var string
*/
#[ORM\Column(name: 'phone', type: 'string', length: 32)]
protected $phone;
/**
* @var string
*/
#[ORM\Column(name: 'registration_number', type: 'string', length: 64, nullable: true)]
protected $registrationNumber;
/**
* @var string
*/
#[ORM\Column(name: 'plate_number', type: 'string', length: 64)]
protected $plateNumber;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'insurance_expiration_date', type: 'datetime', nullable: true)]
protected $insuranceExpirationDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'register_date', type: 'datetime', nullable: true)]
protected $registerDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'end_date', type: 'datetime', nullable: true)]
protected $endDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'updated', type: 'datetime', nullable: true)]
protected $updated;
/**
* @var \AdminBundle\Entity\CarType
*/
#[ORM\JoinColumn(name: 'type', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\CarType::class)]
protected $type;
/**
* @var integer
*/
#[ORM\Column(name: 'status', type: 'integer')]
protected $status;
/**
* @var boolean
*/
#[ORM\Column(name: 'child_extras', type: 'boolean')]
protected $childExtras;
/**
* @var boolean
*/
#[ORM\Column(name: 'disabled_access', type: 'boolean')]
protected $disabledAccess;
#[ORM\OneToMany(targetEntity: \Driver::class, mappedBy: 'car')]
protected $drivers;
/**
* @var string
*/
#[ORM\Column(name: 'phv_license_number', type: 'string', length: 64, nullable: true)]
protected $phvLicenseNumber;
/**
* @var string
*/
#[ORM\Column(name: 'limo_license_number', type: 'string', length: 64, nullable: true)]
protected $limoLicenseNumber;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'phv_expire_date', type: 'date', nullable: true)]
protected $phvExpireDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'limo_license_expiry_date', type: 'date', nullable: true)]
protected $limoLicenseExpiryDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'mot_expiry_date', type: 'date', nullable: true)]
protected $motExpiryDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'vehicle_inspection_expiry_date', type: 'date', nullable: true)]
protected $vehicleInspectionExpiryDate;
/**
* @var string
*/
#[ORM\Column(name: 'phv_license_file', type: 'string', length: 255, nullable: true)]
protected $phvLicenseFile;
/**
* @var string
*/
#[ORM\Column(name: 'v5log_book_file', type: 'string', length: 255, nullable: true)]
protected $v5LogBookFile;
/**
* @var string
*/
#[ORM\Column(name: 'mot_check_file', type: 'string', length: 255, nullable: true)]
protected $motCheckFile;
/**
* @var string
*/
#[ORM\Column(name: 'insurance_file', type: 'string', length: 255, nullable: true)]
protected $insuranceFile;
/**
* @var string
*/
#[ORM\Column(name: 'other_document', type: 'string', length: 255, nullable: true)]
protected $otherDocument;
/**
* @var integer
*/
#[ORM\Column(name: 'max_number_of_passengers', type: 'integer', nullable: true)]
protected $maxNumberOfPassengers;
/**
* @var boolean
*/
#[ORM\Column(name: 'pbia_permit', type: 'boolean', nullable: true)]
protected $pbiaPermit = false;
/**
* @var boolean
*/
#[ORM\Column(name: 'mia_ground_transportation_permit', type: 'boolean', nullable: true)]
protected $miaGroundTransportationPermit = false;
/**
* @var boolean
*/
#[ORM\Column(name: 'port_miami_permit', type: 'boolean', nullable: true)]
protected $portMiamiPermit = false;
/**
* @var boolean
*/
#[ORM\Column(name: 'broward_county_permit', type: 'boolean', nullable: true)]
protected $browardCountyPermit = false;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'pbia_permit_expiration_date', type: 'date', nullable: true)]
protected $pbiaPermitExpirationDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'mia_ground_transportation_permit_expiration_date', type: 'date', nullable: true)]
protected $miaGroundTransportationPermitExpirationDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'port_miami_permit_expiration_date', type: 'date', nullable: true)]
protected $portMiamiPermitExpirationDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'broward_county_permit_expiration_date', type: 'date', nullable: true)]
protected $browardCountyPermitExpirationDate;
/**
* @var string
*/
#[ORM\Column(name: 'limo_license_for_hire', type: 'string', length: 255, nullable: true)]
protected $limoLicenseForHire;
/**
* @var string
*/
#[ORM\Column(name: 'car_registration_certificate', type: 'string', length: 255, nullable: true)]
protected $carRegistrationCertificate;
/**
* @var string
*/
#[ORM\Column(name: 'vehicle_inspection_certificate', type: 'string', length: 255, nullable: true)]
protected $vehicleInspectionCertificate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'creation_date', type: 'date', nullable: true)]
protected $creationDate;
private $motCheckFileFile;
private $phvLicenseFileFile;
private $v5LogBookFileFile;
private $insuranceFileFile;
private $otherDocumentFile;
private $limoLicenseForHireFile;
private $carRegistrationCertificateFile;
private $vehicleInspectionCertificateFile;
public function __construct()
{
$this->drivers = new ArrayCollection();
$this->creationDate = new \DateTime();
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return int
*/
public function getStatus()
{
return $this->status;
}
/**
* @param int $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @return CarType
*/
public function getType()
{
return $this->type;
}
/**
* @param CarType $type
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getPlateNumber()
{
return $this->plateNumber;
}
/**
* @param string $plateNumber
*/
public function setPlateNumber($plateNumber)
{
$this->plateNumber = $plateNumber;
}
/**
* @return string
*/
public function getRegistrationNumber()
{
return $this->registrationNumber;
}
/**
* @param string $registrationNumber
*/
public function setRegistrationNumber($registrationNumber)
{
$this->registrationNumber = $registrationNumber;
}
/**
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* @param string $phone
*/
public function setPhone($phone)
{
$this->phone = $phone;
}
/**
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* @param string $color
*/
public function setColor($color)
{
$this->color = $color;
}
/**
* @return string
*/
public function getYear()
{
return $this->year;
}
/**
* @param string $year
*/
public function setYear($year)
{
$this->year = $year;
}
/**
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* @param string $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return int
*/
public function getMaker()
{
return $this->maker;
}
/**
* @param int $maker
*/
public function setMaker($maker)
{
$this->maker = $maker;
}
/**
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* @param string $code
*/
public function setCode($code)
{
$this->code = $code;
}
/**
* @return boolean
*/
public function isChildExtras()
{
return $this->childExtras;
}
/**
* @param boolean $childExtras
*/
public function setChildExtras($childExtras)
{
$this->childExtras = $childExtras;
}
/**
* @return mixed
*/
public function getDisabledAccess()
{
return $this->disabledAccess;
}
/**
* @param mixed $disabledAccess
*/
public function setDisabledAccess($disabledAccess)
{
$this->disabledAccess = $disabledAccess;
}
/**
* @param int $everyExtraDistanceCost
*/
public function setEveryExtraDistanceCost($everyExtraDistanceCost)
{
$this->everyExtraDistanceCost = $everyExtraDistanceCost;
}
public function getDrivers()
{
return $this->drivers;
}
public function addDriver(Driver $driver)
{
$this->drivers->add($driver);
}
/**
* @return string
*/
public function getPhvLicenseNumber()
{
return $this->phvLicenseNumber;
}
/**
* @param string $phvLicenseNumber
*/
public function setPhvLicenseNumber($phvLicenseNumber)
{
$this->phvLicenseNumber = $phvLicenseNumber;
}
/**
* @return \DateTime
*/
public function getPhvExpireDate()
{
return $this->phvExpireDate;
}
/**
* @param \DateTime $phvExpireDate
*/
public function setPhvExpireDate($phvExpireDate)
{
$this->phvExpireDate = $phvExpireDate;
}
/**
* @return \DateTime
*/
public function getMotExpiryDate()
{
return $this->motExpiryDate;
}
/**
* @param \DateTime $motExpiryDate
*/
public function setMotExpiryDate($motExpiryDate)
{
$this->motExpiryDate = $motExpiryDate;
}
public function __toString()
{
return $this->getCode(). ' '. $this->getMaker() ? $this->getCode(). ' '. $this->getMaker() : 'n\a';
}
/**
* @return \DateTime
*/
public function getInsuranceExpirationDate()
{
return $this->insuranceExpirationDate;
}
/**
* @param \DateTime $insuranceExpirationDate
*/
public function setInsuranceExpirationDate($insuranceExpirationDate)
{
$this->insuranceExpirationDate = $insuranceExpirationDate;
}
/**
* @return \DateTime
*/
public function getRegisterDate()
{
return $this->registerDate;
}
/**
* @param \DateTime $registerDate
*/
public function setRegisterDate($registerDate)
{
$this->registerDate = $registerDate;
}
/**
* @return \DateTime
*/
public function getEndDate()
{
return $this->endDate;
}
/**
* @param \DateTime $endDate
*/
public function setEndDate($endDate)
{
$this->endDate = $endDate;
}
/**
* @return string
*/
public function getPhvLicenseFile()
{
return $this->phvLicenseFile;
}
/**
* @param string $phvLicenseFile
*/
public function setPhvLicenseFile($phvLicenseFile)
{
$this->phvLicenseFile = $phvLicenseFile;
}
/**
* @return string
*/
public function getV5LogBookFile()
{
return $this->v5LogBookFile;
}
/**
* @param string $v5LogBookFile
*/
public function setV5LogBookFile($v5LogBookFile)
{
$this->v5LogBookFile = $v5LogBookFile;
}
/**
* @return string
*/
public function getMotCheckFile()
{
return $this->motCheckFile;
}
/**
* @param string $motCheckFile
*/
public function setMotCheckFile($motCheckFile)
{
$this->motCheckFile = $motCheckFile;
}
/**
* @return string
*/
public function getInsuranceFile()
{
return $this->insuranceFile;
}
/**
* @param string $insuranceFile
*/
public function setInsuranceFile($insuranceFile)
{
$this->insuranceFile = $insuranceFile;
}
/**
* @return string
*/
public function getOtherDocument()
{
return $this->otherDocument;
}
/**
* @param string $otherDocument
*/
public function setOtherDocument($otherDocument)
{
$this->otherDocument = $otherDocument;
}
/**
* @return string
*/
public function getCarRegistrationCertificate()
{
return $this->carRegistrationCertificate;
}
/**
* @param string $carRegistrationCertificate
*/
public function setCarRegistrationCertificate($carRegistrationCertificate)
{
$this->carRegistrationCertificate = $carRegistrationCertificate;
}
/**
* @return string
*/
public function getVehicleInspectionCertificate()
{
return $this->vehicleInspectionCertificate;
}
/**
* @param string $vehicleInspectionCertificate
*/
public function setVehicleInspectionCertificate($vehicleInspectionCertificate)
{
$this->vehicleInspectionCertificate = $vehicleInspectionCertificate;
}
/**
* @return string
*/
public function getLimoLicenseForHire()
{
return $this->limoLicenseForHire;
}
/**
* @param string $limoLicenseForHire
*/
public function setLimoLicenseForHire($limoLicenseForHire)
{
$this->limoLicenseForHire = $limoLicenseForHire;
}
public function getUploadFilePath()
{
if (!is_dir(self::VEHICLE_FILE_FOLDER.$this->id)) {
mkdir(self::VEHICLE_FILE_FOLDER.$this->id, 0777, true);
}
return self::VEHICLE_FILE_FOLDER.$this->id.'/';
}
/**
* @param UploadedFile $phvLicenseFileFile
*/
public function setPhvLicenseFileFile(UploadedFile $phvLicenseFileFile = null)
{
$this->phvLicenseFileFile = $phvLicenseFileFile;
}
/**
* @param UploadedFile $v5LogBookFileFile
*/
public function setV5LogBookFileFile(UploadedFile $v5LogBookFileFile = null)
{
$this->v5LogBookFileFile = $v5LogBookFileFile;
}
/**
* @param UploadedFile $motCheckFileFile
*/
public function setMotCheckFileFile(UploadedFile $motCheckFileFile = null)
{
$this->motCheckFileFile = $motCheckFileFile;
}
/**
* @param UploadedFile $insuranceFileFile
*/
public function setInsuranceFileFile(UploadedFile $insuranceFileFile = null)
{
$this->insuranceFileFile = $insuranceFileFile;
}
/**
* @param UploadedFile $otherDocumentFile
*/
public function setOtherDocumentFile(UploadedFile $otherDocumentFile = null)
{
$this->otherDocumentFile = $otherDocumentFile;
}
/**
* @param UploadedFile $limoLicenseForHireFile
*/
public function setLimoLicenseForHireFile(UploadedFile $limoLicenseForHireFile = null)
{
$this->limoLicenseForHireFile = $limoLicenseForHireFile;
}
/**
* @param UploadedFile $carRegistrationCertificateFile
*/
public function setCarRegistrationCertificateFile(UploadedFile $carRegistrationCertificateFile = null)
{
$this->carRegistrationCertificateFile = $carRegistrationCertificateFile;
}
/**
* @param UploadedFile $vehicleInspectionCertificateFile
*/
public function setVehicleInspectionCertificateFile(UploadedFile $vehicleInspectionCertificateFile = null)
{
$this->vehicleInspectionCertificateFile = $vehicleInspectionCertificateFile;
}
public function setUpdated($updated)
{
$this->updated = $updated;
}
public function getUpdated()
{
return $this->updated;
}
public function refreshUpdated()
{
$this->setUpdated(new \DateTime());
}
/**
* @return int
*/
public function getMaxNumberOfPassengers()
{
return $this->maxNumberOfPassengers;
}
/**
* @param int $maxNumberOfPassengers
*/
public function setMaxNumberOfPassengers($maxNumberOfPassengers)
{
$this->maxNumberOfPassengers = $maxNumberOfPassengers;
}
/**
* @return UploadedFile
*/
public function getPhvLicenseFileFile()
{
return $this->phvLicenseFileFile;
}
/**
* @return UploadedFile
*/
public function getV5LogBookFileFile()
{
return $this->v5LogBookFileFile;
}
/**
* @return UploadedFile
*/
public function getMotCheckFileFile()
{
return $this->motCheckFileFile;
}
/**
* @return UploadedFile
*/
public function getInsuranceFileFile()
{
return $this->insuranceFileFile;
}
/**
* @return UploadedFile
*/
public function getOtherDocumentFile()
{
return $this->otherDocumentFile;
}
/**
* @return UploadedFile
*/
public function getVehicleInspectionCertificateFile()
{
return $this->vehicleInspectionCertificateFile;
}
/**
* @return UploadedFile
*/
public function getLimoLicenseForHireFile()
{
return $this->limoLicenseForHireFile;
}
/**
* @return UploadedFile
*/
public function getCarRegistrationCertificateFile()
{
return $this->carRegistrationCertificateFile;
}
public function getPhvLicenseFilePath()
{
if (!$this->phvLicenseFile) {
return ;
}
return $this->getUploadFilePath() . $this->phvLicenseFile;
}
public function getV5LogBookFilePath()
{
if (!$this->v5LogBookFile) {
return ;
}
return $this->getUploadFilePath() . $this->v5LogBookFile;
}
public function getMotCheckFilePath()
{
if (!$this->motCheckFile) {
return ;
}
return $this->getUploadFilePath() . $this->motCheckFile;
}
public function getInsuranceFilePath()
{
if (!$this->insuranceFile) {
return ;
}
return $this->getUploadFilePath() . $this->insuranceFile;
}
public function getOtherDocumentFilePath()
{
if (!$this->otherDocument) {
return ;
}
return $this->getUploadFilePath() . $this->otherDocument;
}
public function getCarRegistrationCertificateFilePath()
{
if (!$this->carRegistrationCertificate) {
return ;
}
return $this->getUploadFilePath() . $this->carRegistrationCertificate;
}
public function getLimoLicenseForHireFilePath()
{
if (!$this->limoLicenseForHire) {
return ;
}
return $this->getUploadFilePath() . $this->limoLicenseForHire;
}
public function getVehicleInspectionCertificateFilePath()
{
if (!$this->vehicleInspectionCertificate) {
return ;
}
return $this->getUploadFilePath() . $this->vehicleInspectionCertificate;
}
public function uploadCarRegistrationCertificate()
{
if (null === $this->getCarRegistrationCertificateFile()) {
return;
}
$this->removeCarRegistrationCertificateFile();
$nDate= new \DateTime();
$filename = 'CAR_REGISTRATION_CERTIFICATE_'.$nDate->format('Y-m-d');
$this->carRegistrationCertificate = $filename.'.'.$this->getCarRegistrationCertificateFile()->guessExtension();
$this->getCarRegistrationCertificateFile()->move(
$this->getUploadFilePath(),
$this->carRegistrationCertificate
);
$this->setCarRegistrationCertificateFile(null);
}
public function uploadVehicleInspectionCertificate()
{
if (null === $this->getVehicleInspectionCertificateFile()) {
return;
}
$this->removeVehicleInspectionCertificateFile();
$nDate= new \DateTime();
$filename = 'VEHICLE_INSPECTION_CERTIFICATE_'.$nDate->format('Y-m-d');
$this->vehicleInspectionCertificate = $filename.'.'.$this->getVehicleInspectionCertificateFile()->guessExtension();
$this->getVehicleInspectionCertificateFile()->move(
$this->getUploadFilePath(),
$this->vehicleInspectionCertificate
);
$this->setVehicleInspectionCertificateFile(null);
}
public function uploadLimoLicenseForHire()
{
if (null === $this->getLimoLicenseForHireFile()) {
return;
}
$this->removeLimoLicenseForHireFile();
$nDate= new \DateTime();
$filename = 'LIMO_LICENSE_FOR_HIRE_'.$nDate->format('Y-m-d');
$this->limoLicenseForHire = $filename.'.'.$this->getLimoLicenseForHireFile()->guessExtension();
$this->getLimoLicenseForHireFile()->move(
$this->getUploadFilePath(),
$this->limoLicenseForHire
);
$this->setLimoLicenseForHireFile(null);
}
public function uploadPhvLicenseFile()
{
if (null === $this->getPhvLicenseFileFile()) {
return;
}
$this->removePhvLicenseFileFile();
$nDate= new \DateTime();
$filename = 'VEHICLE_PHV_LICENSE_'.$nDate->format('Y-m-d');
$this->phvLicenseFile = $filename.'.'.$this->getPhvLicenseFileFile()->guessExtension();
$this->getPhvLicenseFileFile()->move(
$this->getUploadFilePath(),
$this->phvLicenseFile
);
$this->setPhvLicenseFileFile(null);
}
public function uploadV5LogBookFile()
{
if (null === $this->getV5LogBookFileFile()) {
return;
}
$this->removeV5LogBookFileFile();
$nDate= new \DateTime();
$filename = 'VEHICLE_V5LOG_BOOK_'.$nDate->format('Y-m-d');
$this->v5LogBookFile = $filename.'.'.$this->getV5LogBookFileFile()->guessExtension();
$this->getV5LogBookFileFile()->move(
$this->getUploadFilePath(),
$this->v5LogBookFile
);
$this->setV5LogBookFileFile(null);
}
public function uploadMotCheckFile()
{
if (null === $this->getMotCheckFileFile()) {
return;
}
$this->removeMotCheckFileFile();
$nDate= new \DateTime();
$filename = 'VEHICLE_MOT_CHECK_'.$nDate->format('Y-m-d');
$this->motCheckFile = $filename.'.'.$this->getMotCheckFileFile()->guessExtension();
$this->getMotCheckFileFile()->move(
$this->getUploadFilePath(),
$this->motCheckFile
);
$this->setMotCheckFileFile(null);
}
public function uploadInsuranceFile()
{
if (null === $this->getInsuranceFileFile()) {
return;
}
$this->removeInsuranceFileFile();
$nDate= new \DateTime();
$filename = 'VEHICLE_INSURANCE_'.$nDate->format('Y-m-d');
$this->insuranceFile = $filename.'.'.$this->getInsuranceFileFile()->guessExtension();
$this->getInsuranceFileFile()->move(
$this->getUploadFilePath(),
$this->insuranceFile
);
$this->setInsuranceFileFile(null);
}
public function uploadOtherDocumentFile()
{
if (null === $this->getOtherDocumentFile()) {
return;
}
$this->removeOtherDocumentFile();
$nDate= new \DateTime();
$filename = 'VEHICLE_OTHER_DOCUMENT_'.$nDate->format('Y-m-d');
$this->otherDocument = $filename.'.'.$this->getOtherDocumentFile()->guessExtension();
$this->getOtherDocumentFile()->move(
$this->getUploadFilePath(),
$this->otherDocument
);
$this->setOtherDocumentFile(null);
}
#[ORM\PreUpdate]
#[ORM\PrePersist]
public function lifecycleFileUpload()
{
$this->uploadLimoLicenseForHire();
$this->uploadVehicleInspectionCertificate();
$this->uploadCarRegistrationCertificate();
$this->uploadPhvLicenseFile();
$this->uploadV5LogBookFile();
$this->uploadInsuranceFile();
$this->uploadMotCheckFile();
$this->uploadOtherDocumentFile();
}
#[ORM\PostRemove]
public function removeUpload()
{
$this->removeLimoLicenseForHireFile();
$this->removeVehicleInspectionCertificateFile();
$this->removeCarRegistrationCertificateFile();
$this->removePhvLicenseFileFile();
$this->removeV5LogBookFileFile();
$this->removeOtherDocumentFile();
$this->removeInsuranceFileFile();
$this->removeMotCheckFileFile();
}
public function removeLimoLicenseForHireFile()
{
if ($limoLicenseForHireFile = $this->getLimoLicenseForHireFilePath()) {
@unlink($limoLicenseForHireFile);
}
}
public function removeCarRegistrationCertificateFile()
{
if ($carRegistrationCertificateFile = $this->getCarRegistrationCertificateFilePath()) {
@unlink($carRegistrationCertificateFile);
}
}
public function removeVehicleInspectionCertificateFile()
{
if ($vehicleInspectionCertificateFile = $this->getVehicleInspectionCertificateFilePath()) {
@unlink($vehicleInspectionCertificateFile);
}
}
public function removePhvLicenseFileFile()
{
if ($phvLicenseFileFile = $this->getPhvLicenseFilePath()) {
@unlink($phvLicenseFileFile);
}
}
public function removeV5LogBookFileFile()
{
if ($v5LogBookFileFile = $this->getV5LogBookFilePath()) {
@unlink($v5LogBookFileFile);
}
}
public function removeMotCheckFileFile()
{
if ($motCheckFileFile = $this->getMotCheckFilePath()) {
@unlink($motCheckFileFile);
}
}
public function removeInsuranceFileFile()
{
if ($insuranceFileFile = $this->getInsuranceFilePath()) {
@unlink($insuranceFileFile);
}
}
public function removeOtherDocumentFile()
{
if ($otherDocumentFile = $this->getOtherDocumentFilePath()) {
@unlink($otherDocumentFile);
}
}
/**
* @return string
*/
public function getLimoLicenseNumber()
{
return $this->limoLicenseNumber;
}
/**
* @param string $limoLicenseNumber
*/
public function setLimoLicenseNumber($limoLicenseNumber)
{
$this->limoLicenseNumber = $limoLicenseNumber;
}
/**
* @return \DateTime
*/
public function getLimoLicenseExpiryDate()
{
return $this->limoLicenseExpiryDate;
}
/**
* @param \DateTime $limoLicenseExpiryDate
*/
public function setLimoLicenseExpiryDate($limoLicenseExpiryDate)
{
$this->limoLicenseExpiryDate = $limoLicenseExpiryDate;
}
/**
* @return \DateTime
*/
public function getVehicleInspectionExpiryDate()
{
return $this->vehicleInspectionExpiryDate;
}
/**
* @param \DateTime $vehicleInspectionExpiryDate
*/
public function setVehicleInspectionExpiryDate($vehicleInspectionExpiryDate)
{
$this->vehicleInspectionExpiryDate = $vehicleInspectionExpiryDate;
}
/**
* @return bool
*/
public function isPbiaPermit()
{
return $this->pbiaPermit;
}
/**
* @param bool $pbiaPermit
*/
public function setPbiaPermit($pbiaPermit)
{
$this->pbiaPermit = $pbiaPermit;
}
/**
* @return bool
*/
public function isMiaGroundTransportationPermit()
{
return $this->miaGroundTransportationPermit;
}
/**
* @param bool $miaGroundTransportationPermit
*/
public function setMiaGroundTransportationPermit($miaGroundTransportationPermit)
{
$this->miaGroundTransportationPermit = $miaGroundTransportationPermit;
}
/**
* @return bool
*/
public function isPortMiamiPermit()
{
return $this->portMiamiPermit;
}
/**
* @param bool $portMiamiPermit
*/
public function setPortMiamiPermit($portMiamiPermit)
{
$this->portMiamiPermit = $portMiamiPermit;
}
/**
* @return bool
*/
public function isBrowardCountyPermit()
{
return $this->browardCountyPermit;
}
/**
* @param bool $browardCountyPermit
*/
public function setBrowardCountyPermit($browardCountyPermit)
{
$this->browardCountyPermit = $browardCountyPermit;
}
/**
* @return \DateTime
*/
public function getPbiaPermitExpirationDate()
{
return $this->pbiaPermitExpirationDate;
}
/**
* @param \DateTime $pbiaPermitExpirationDate
*/
public function setPbiaPermitExpirationDate($pbiaPermitExpirationDate)
{
$this->pbiaPermitExpirationDate = $pbiaPermitExpirationDate;
}
/**
* @return \DateTime
*/
public function getMiaGroundTransportationPermitExpirationDate()
{
return $this->miaGroundTransportationPermitExpirationDate;
}
/**
* @param \DateTime $miaGroundTransportationPermitExpirationDate
*/
public function setMiaGroundTransportationPermitExpirationDate($miaGroundTransportationPermitExpirationDate)
{
$this->miaGroundTransportationPermitExpirationDate = $miaGroundTransportationPermitExpirationDate;
}
/**
* @return \DateTime
*/
public function getPortMiamiPermitExpirationDate()
{
return $this->portMiamiPermitExpirationDate;
}
/**
* @param \DateTime $portMiamiPermitExpirationDate
*/
public function setPortMiamiPermitExpirationDate($portMiamiPermitExpirationDate)
{
$this->portMiamiPermitExpirationDate = $portMiamiPermitExpirationDate;
}
/**
* @return \DateTime
*/
public function getBrowardCountyPermitExpirationDate()
{
return $this->browardCountyPermitExpirationDate;
}
/**
* @param \DateTime $browardCountyPermitExpirationDate
*/
public function setBrowardCountyPermitExpirationDate($browardCountyPermitExpirationDate)
{
$this->browardCountyPermitExpirationDate = $browardCountyPermitExpirationDate;
}
/**
* @return \DateTime
*/
public function getCreationDate()
{
return $this->creationDate;
}
/**
* @param \DateTime $creationDate
*/
public function setCreationDate($creationDate)
{
$this->creationDate = $creationDate;
}
}