src/Entity/CarResale.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CarResaleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=CarResaleRepository::class)
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class CarResale
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=5)
  19.      */
  20.     private $currency;
  21.     /**
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $price;
  25.     /**
  26.      * @ORM\Column(type="boolean")
  27.      */
  28.     private $isDone;
  29.     /**
  30.      * @ORM\Column(type="datetime")
  31.      */
  32.     private $createdAt;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=true)
  35.      */
  36.     private $updatedAt;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=Car::class, inversedBy="carResales")
  39.      * @ORM\JoinColumn(nullable=false)
  40.      */
  41.     private $car;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="carResales")
  44.      * @ORM\JoinColumn(nullable=true)
  45.      */
  46.     private $user;
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getCurrency(): ?string
  52.     {
  53.         return $this->currency;
  54.     }
  55.     public function setCurrency(string $currency): self
  56.     {
  57.         $this->currency $currency;
  58.         return $this;
  59.     }
  60.     public function getPrice(): ?int
  61.     {
  62.         return $this->price;
  63.     }
  64.     public function setPrice($price): self
  65.     {
  66.         $this->price str_replace('.'''$price);
  67.         return $this;
  68.     }
  69.     public function getIsDone(): ?bool
  70.     {
  71.         return $this->isDone;
  72.     }
  73.     public function setIsDone(bool $isDone): self
  74.     {
  75.         $this->isDone $isDone;
  76.         return $this;
  77.     }
  78.     public function getCreatedAt(): ?\DateTimeInterface
  79.     {
  80.         return $this->createdAt;
  81.     }
  82.     /**
  83.      * @ORM\PrePersist
  84.      */
  85.     public function setCreatedAt(): self
  86.     {
  87.         $this->createdAt = new \DateTime();
  88.         return $this;
  89.     }
  90.     public function getUpdatedAt(): ?\DateTimeInterface
  91.     {
  92.         return $this->updatedAt;
  93.     }
  94.     /**
  95.      * @ORM\PreUpdate
  96.      */
  97.     public function setUpdatedAt(): self
  98.     {
  99.         $this->updatedAt = new \DateTime();
  100.         return $this;
  101.     }
  102.     public function getCar(): ?Car
  103.     {
  104.         return $this->car;
  105.     }
  106.     public function setCar(?Car $car): self
  107.     {
  108.         $this->car $car;
  109.         return $this;
  110.     }
  111.     public function getUser(): ?User
  112.     {
  113.         return $this->user;
  114.     }
  115.     public function setUser(?User $user): self
  116.     {
  117.         $this->user $user;
  118.         return $this;
  119.     }
  120. }