<?php
namespace App\Entity;
use App\Repository\CarSaleCarPaymentRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CarSaleCarPaymentRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class CarSaleCarPayment
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updateAt;
/**
* @ORM\ManyToOne(targetEntity=CarSale::class, inversedBy="carPayment", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $carSalePay;
//, cascade={"persist", "remove"}
/**
* @ORM\OneToOne(targetEntity=Car::class)
* @ORM\JoinColumn(nullable=false)
*/
private $car;
public function getId(): ?int
{
return $this->id;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAt(): self
{
$this->createdAt = new \DateTime();
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
public function getCarSalePay(): ?CarSale
{
return $this->carSalePay;
}
public function setCarSalePay(?CarSale $carSalePay): self
{
$this->carSalePay = $carSalePay;
return $this;
}
public function getCar(): ?Car
{
return $this->car;
}
public function setCar(Car $car): self
{
$this->car = $car;
return $this;
}
}