src/Entity/CarSaleCarPayment.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CarSaleCarPaymentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=CarSaleCarPaymentRepository::class)
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class CarSaleCarPayment
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $description;
  21.     /**
  22.      * @ORM\Column(type="datetime")
  23.      */
  24.     private $createdAt;
  25.     /**
  26.      * @ORM\Column(type="datetime", nullable=true)
  27.      */
  28.     private $updateAt;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=CarSale::class, inversedBy="carPayment", cascade={"persist"})
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $carSalePay;
  34.     //, cascade={"persist", "remove"}
  35.     /**
  36.      * @ORM\OneToOne(targetEntity=Car::class)
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $car;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getDescription(): ?string
  45.     {
  46.         return $this->description;
  47.     }
  48.     public function setDescription(?string $description): self
  49.     {
  50.         $this->description $description;
  51.         return $this;
  52.     }
  53.     public function getCreatedAt(): ?\DateTimeInterface
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     /**
  58.      * @ORM\PrePersist
  59.      */
  60.     public function setCreatedAt(): self
  61.     {
  62.         $this->createdAt = new \DateTime();
  63.         return $this;
  64.     }
  65.     public function getUpdateAt(): ?\DateTimeInterface
  66.     {
  67.         return $this->updateAt;
  68.     }
  69.     public function setUpdateAt(?\DateTimeInterface $updateAt): self
  70.     {
  71.         $this->updateAt $updateAt;
  72.         return $this;
  73.     }
  74.     public function getCarSalePay(): ?CarSale
  75.     {
  76.         return $this->carSalePay;
  77.     }
  78.     public function setCarSalePay(?CarSale $carSalePay): self
  79.     {
  80.         $this->carSalePay $carSalePay;
  81.         return $this;
  82.     }
  83.     public function getCar(): ?Car
  84.     {
  85.         return $this->car;
  86.     }
  87.     public function setCar(Car $car): self
  88.     {
  89.         $this->car $car;
  90.         return $this;
  91.     }
  92. }