src/Entity/Garages/GarageAppointment.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Garages;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Interfaces\SiteInterface;
  6. use App\Entity\MiniAbstractBase;
  7. use App\Entity\Traits\GarageTrait;
  8. use App\Entity\Traits\SiteTrait;
  9. use App\Enum\GarageAppointmentStatusEnum;
  10. use App\Repository\Garages\GarageAppointmentRepository;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. /**
  14.  * @ORM\Table(name="vulco_garage_appointment", indexes={@ORM\Index(name="garage_appointment_site_idx", columns={"site"})})
  15.  *
  16.  * @ORM\Entity(repositoryClass=GarageAppointmentRepository::class)
  17.  *
  18.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  19.  *
  20.  * @SiteAware(siteFieldName="site")
  21.  */
  22. class GarageAppointment extends AbstractBase implements SiteInterface
  23. {
  24.     use GarageTrait;
  25.     use SiteTrait;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=false, options={"default": 0})
  28.      */
  29.     private int $status GarageAppointmentStatusEnum::SENT;
  30.     /**
  31.      * @ORM\Column(type="datetime", nullable=false)
  32.      */
  33.     private \DateTimeInterface $date;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private ?string $customerName null;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private ?string $customerStreet null;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private ?string $customerCity null;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private ?string $customerZip null;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private ?string $customerPhone null;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private ?string $customerEmail null;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private ?string $vehicleBrand null;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private ?string $vehicleModel null;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private ?string $vehiclePlate null;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private ?string $vehicleTyresSize null;
  74.     /**
  75.      * @ORM\Column(type="text", length=10000, nullable=true)
  76.      */
  77.     private ?string $comments null;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity="App\Entity\Garages\Garage")
  80.      *
  81.      * @ORM\JoinColumn(name="garage_id", referencedColumnName="id")
  82.      */
  83.     private Garage $garage;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\Entity\Garages\GarageService")
  86.      *
  87.      * @ORM\JoinColumn(name="service_id", referencedColumnName="id")
  88.      */
  89.     private ?GarageService $service null;
  90.     /**
  91.      * @ORM\ManyToOne(targetEntity="App\Entity\Garages\GarageOffer2", inversedBy="garageAppointments")
  92.      *
  93.      * @ORM\JoinColumn(name="garage_offer_2_id", referencedColumnName="id")
  94.      */
  95.     private ?GarageOffer2 $garageOffer2 null;
  96.     public function getStatus(): int
  97.     {
  98.         return $this->status;
  99.     }
  100.     public function getStatusString(): string
  101.     {
  102.         $result MiniAbstractBase::DEFAULT_EMPTY_STRING;
  103.         if (array_key_exists($this->getStatus(), GarageAppointmentStatusEnum::getTranslations())) {
  104.             $result GarageAppointmentStatusEnum::getTranslations()[$this->getStatus()];
  105.         }
  106.         return $result;
  107.     }
  108.     public function setStatus(int $status): self
  109.     {
  110.         $this->status $status;
  111.         return $this;
  112.     }
  113.     public function getDate(): \DateTimeInterface
  114.     {
  115.         return $this->date;
  116.     }
  117.     public function setDate(\DateTimeInterface $date): self
  118.     {
  119.         $this->date $date;
  120.         return $this;
  121.     }
  122.     public function getCustomerName(): ?string
  123.     {
  124.         return $this->customerName;
  125.     }
  126.     public function setCustomerName(?string $customerName): self
  127.     {
  128.         $this->customerName $customerName;
  129.         return $this;
  130.     }
  131.     public function getCustomerStreet(): ?string
  132.     {
  133.         return $this->customerStreet;
  134.     }
  135.     public function setCustomerStreet(?string $customerStreet): self
  136.     {
  137.         $this->customerStreet $customerStreet;
  138.         return $this;
  139.     }
  140.     public function getCustomerCity(): ?string
  141.     {
  142.         return $this->customerCity;
  143.     }
  144.     public function setCustomerCity(?string $customerCity): self
  145.     {
  146.         $this->customerCity $customerCity;
  147.         return $this;
  148.     }
  149.     public function getCustomerZip(): ?string
  150.     {
  151.         return $this->customerZip;
  152.     }
  153.     public function setCustomerZip(?string $customerZip): self
  154.     {
  155.         $this->customerZip $customerZip;
  156.         return $this;
  157.     }
  158.     public function getCustomerPhone(): ?string
  159.     {
  160.         return $this->customerPhone;
  161.     }
  162.     public function setCustomerPhone(?string $customerPhone): self
  163.     {
  164.         $this->customerPhone $customerPhone;
  165.         return $this;
  166.     }
  167.     public function getCustomerEmail(): ?string
  168.     {
  169.         return $this->customerEmail;
  170.     }
  171.     public function setCustomerEmail(?string $customerEmail): self
  172.     {
  173.         $this->customerEmail $customerEmail;
  174.         return $this;
  175.     }
  176.     public function getVehicleBrand(): ?string
  177.     {
  178.         return $this->vehicleBrand;
  179.     }
  180.     public function setVehicleBrand(?string $vehicleBrand): self
  181.     {
  182.         $this->vehicleBrand $vehicleBrand;
  183.         return $this;
  184.     }
  185.     public function getVehicleModel(): ?string
  186.     {
  187.         return $this->vehicleModel;
  188.     }
  189.     public function setVehicleModel(?string $vehicleModel): self
  190.     {
  191.         $this->vehicleModel $vehicleModel;
  192.         return $this;
  193.     }
  194.     public function getVehiclePlate(): ?string
  195.     {
  196.         return $this->vehiclePlate;
  197.     }
  198.     public function setVehiclePlate(?string $vehiclePlate): self
  199.     {
  200.         $this->vehiclePlate $vehiclePlate;
  201.         return $this;
  202.     }
  203.     public function getVehicleTyresSize(): ?string
  204.     {
  205.         return $this->vehicleTyresSize;
  206.     }
  207.     public function setVehicleTyresSize(?string $vehicleTyresSize): self
  208.     {
  209.         $this->vehicleTyresSize $vehicleTyresSize;
  210.         return $this;
  211.     }
  212.     public function getComments(): ?string
  213.     {
  214.         return $this->comments;
  215.     }
  216.     public function setComments(?string $comments): self
  217.     {
  218.         $this->comments $comments;
  219.         return $this;
  220.     }
  221.     public function getService(): ?GarageService
  222.     {
  223.         return $this->service;
  224.     }
  225.     public function setService(?GarageService $service): self
  226.     {
  227.         $this->service $service;
  228.         return $this;
  229.     }
  230.     public function getGarageOffer2(): ?GarageOffer2
  231.     {
  232.         return $this->garageOffer2;
  233.     }
  234.     public function setGarageOffer2(?GarageOffer2 $garageOffer2): self
  235.     {
  236.         $this->garageOffer2 $garageOffer2;
  237.         return $this;
  238.     }
  239.     public function __toString(): string
  240.     {
  241.         return $this->id ? ((string) $this->getId()).' · '.$this->getDateAsString($this->getDate()).' · '.$this->getGarage().' · '.$this->getCustomerName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  242.     }
  243. }