<?php
namespace App\Entity;
use App\Service\Helper\DateTimeHelper;
use App\Service\Helper\Generator;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* @ORM\Table(name="customers__garage_cars")
* @ORM\Entity(repositoryClass="App\Repository\CustomerGarageRepository")
*/
class CustomerGarage
{
use IdTrait;
/**
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private DateTime $createdAt;
/**
* @ORM\Column(name="car_brand", type="string", nullable=true)
*/
private ?string $carBrand;
/**
* @ORM\Column(name="car_model", type="string", nullable=true)
*/
private ?string $carModel;
/**
* @ORM\Column(name="car_vin", type="string", nullable=true)
*/
private ?string $carVin;
/**
* @ORM\ManyToOne(targetEntity="Customer")
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)
**/
private Customer $customer;
/**
* @throws Exception
*/
public function __construct(?string $carBrand, ?string $carModel, ?string $carVin, Customer $customer)
{
$this->carBrand = $carBrand;
$this->carModel = $carModel;
$this->carVin = $carVin;
$this->customer = $customer;
$this->createdAt = DateTimeHelper::getNowDateTime();
}
public function getCarBrand(): ?string
{
return $this->carBrand;
}
public function setCarBrand(?string $carBrand): CustomerGarage
{
$this->carBrand = $carBrand;
return $this;
}
public function getCarModel(): ?string
{
return $this->carModel;
}
public function setCarModel(?string $carModel): CustomerGarage
{
$this->carModel = $carModel;
return $this;
}
public function getCarVin(): ?string
{
return $this->carVin;
}
public function setCarVin(?string $carVin): CustomerGarage
{
$this->carVin = $carVin;
return $this;
}
}