<?php
namespace App\Entity\Garages;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\MiniAbstractBase;
use App\Entity\Traits\GarageTrait;
use App\Entity\Traits\SiteTrait;
use App\Enum\GarageAppointmentStatusEnum;
use App\Repository\Garages\GarageAppointmentRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table(name="vulco_garage_appointment", indexes={@ORM\Index(name="garage_appointment_site_idx", columns={"site"})})
*
* @ORM\Entity(repositoryClass=GarageAppointmentRepository::class)
*
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
*
* @SiteAware(siteFieldName="site")
*/
class GarageAppointment extends AbstractBase implements SiteInterface
{
use GarageTrait;
use SiteTrait;
/**
* @ORM\Column(type="integer", nullable=false, options={"default": 0})
*/
private int $status = GarageAppointmentStatusEnum::SENT;
/**
* @ORM\Column(type="datetime", nullable=false)
*/
private \DateTimeInterface $date;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $customerName = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $customerStreet = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $customerCity = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $customerZip = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $customerPhone = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $customerEmail = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $vehicleBrand = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $vehicleModel = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $vehiclePlate = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $vehicleTyresSize = null;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
*/
private ?string $comments = null;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Garages\Garage")
*
* @ORM\JoinColumn(name="garage_id", referencedColumnName="id")
*/
private Garage $garage;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Garages\GarageService")
*
* @ORM\JoinColumn(name="service_id", referencedColumnName="id")
*/
private ?GarageService $service = null;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Garages\GarageOffer2", inversedBy="garageAppointments")
*
* @ORM\JoinColumn(name="garage_offer_2_id", referencedColumnName="id")
*/
private ?GarageOffer2 $garageOffer2 = null;
public function getStatus(): int
{
return $this->status;
}
public function getStatusString(): string
{
$result = MiniAbstractBase::DEFAULT_EMPTY_STRING;
if (array_key_exists($this->getStatus(), GarageAppointmentStatusEnum::getTranslations())) {
$result = GarageAppointmentStatusEnum::getTranslations()[$this->getStatus()];
}
return $result;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getDate(): \DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getCustomerName(): ?string
{
return $this->customerName;
}
public function setCustomerName(?string $customerName): self
{
$this->customerName = $customerName;
return $this;
}
public function getCustomerStreet(): ?string
{
return $this->customerStreet;
}
public function setCustomerStreet(?string $customerStreet): self
{
$this->customerStreet = $customerStreet;
return $this;
}
public function getCustomerCity(): ?string
{
return $this->customerCity;
}
public function setCustomerCity(?string $customerCity): self
{
$this->customerCity = $customerCity;
return $this;
}
public function getCustomerZip(): ?string
{
return $this->customerZip;
}
public function setCustomerZip(?string $customerZip): self
{
$this->customerZip = $customerZip;
return $this;
}
public function getCustomerPhone(): ?string
{
return $this->customerPhone;
}
public function setCustomerPhone(?string $customerPhone): self
{
$this->customerPhone = $customerPhone;
return $this;
}
public function getCustomerEmail(): ?string
{
return $this->customerEmail;
}
public function setCustomerEmail(?string $customerEmail): self
{
$this->customerEmail = $customerEmail;
return $this;
}
public function getVehicleBrand(): ?string
{
return $this->vehicleBrand;
}
public function setVehicleBrand(?string $vehicleBrand): self
{
$this->vehicleBrand = $vehicleBrand;
return $this;
}
public function getVehicleModel(): ?string
{
return $this->vehicleModel;
}
public function setVehicleModel(?string $vehicleModel): self
{
$this->vehicleModel = $vehicleModel;
return $this;
}
public function getVehiclePlate(): ?string
{
return $this->vehiclePlate;
}
public function setVehiclePlate(?string $vehiclePlate): self
{
$this->vehiclePlate = $vehiclePlate;
return $this;
}
public function getVehicleTyresSize(): ?string
{
return $this->vehicleTyresSize;
}
public function setVehicleTyresSize(?string $vehicleTyresSize): self
{
$this->vehicleTyresSize = $vehicleTyresSize;
return $this;
}
public function getComments(): ?string
{
return $this->comments;
}
public function setComments(?string $comments): self
{
$this->comments = $comments;
return $this;
}
public function getService(): ?GarageService
{
return $this->service;
}
public function setService(?GarageService $service): self
{
$this->service = $service;
return $this;
}
public function getGarageOffer2(): ?GarageOffer2
{
return $this->garageOffer2;
}
public function setGarageOffer2(?GarageOffer2 $garageOffer2): self
{
$this->garageOffer2 = $garageOffer2;
return $this;
}
public function __toString(): string
{
return $this->id ? ((string) $this->getId()).' · '.$this->getDateAsString($this->getDate()).' · '.$this->getGarage().' · '.$this->getCustomerName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}