src/Entity/CustomerGarage.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Service\Helper\DateTimeHelper;
  4. use App\Service\Helper\Generator;
  5. use DateTime;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Exception;
  10. /**
  11.  * @ORM\Table(name="customers__garage_cars")
  12.  * @ORM\Entity(repositoryClass="App\Repository\CustomerGarageRepository")
  13.  */
  14. class CustomerGarage
  15. {
  16.     use IdTrait;
  17.     /**
  18.      * @ORM\Column(name="created_at", type="datetime", nullable=false)
  19.      */
  20.     private DateTime $createdAt;
  21.     /**
  22.      * @ORM\Column(name="car_brand", type="string", nullable=true)
  23.      */
  24.     private ?string $carBrand;
  25.     /**
  26.      * @ORM\Column(name="car_model", type="string", nullable=true)
  27.      */
  28.     private ?string $carModel;
  29.     /**
  30.      * @ORM\Column(name="car_vin", type="string", nullable=true)
  31.      */
  32.     private ?string $carVin;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="Customer")
  35.      * @ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)
  36.      **/
  37.     private Customer $customer;
  38.     /**
  39.      * @throws Exception
  40.      */
  41.     public function __construct(?string $carBrand, ?string $carModel, ?string $carVinCustomer $customer)
  42.     {
  43.         $this->carBrand $carBrand;
  44.         $this->carModel $carModel;
  45.         $this->carVin $carVin;
  46.         $this->customer $customer;
  47.         $this->createdAt DateTimeHelper::getNowDateTime();
  48.     }
  49.     public function getCarBrand(): ?string
  50.     {
  51.         return $this->carBrand;
  52.     }
  53.     public function setCarBrand(?string $carBrand): CustomerGarage
  54.     {
  55.         $this->carBrand $carBrand;
  56.         return $this;
  57.     }
  58.     public function getCarModel(): ?string
  59.     {
  60.         return $this->carModel;
  61.     }
  62.     public function setCarModel(?string $carModel): CustomerGarage
  63.     {
  64.         $this->carModel $carModel;
  65.         return $this;
  66.     }
  67.     public function getCarVin(): ?string
  68.     {
  69.         return $this->carVin;
  70.     }
  71.     public function setCarVin(?string $carVin): CustomerGarage
  72.     {
  73.         $this->carVin $carVin;
  74.         return $this;
  75.     }
  76. }