src/Entity/VehicleTheft.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VehicleTheftRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassVehicleTheftRepository::class)]
  7. #[ORM\Table(name'vehicle_theft')]
  8. class VehicleTheft
  9. {
  10.     #[ORM\Column(name'id'type'integer')]
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue(strategy'AUTO')]
  13.     private ?int $id;
  14.     #[ORM\Column(type'boolean')]
  15.     private bool $isDeleted false;
  16.     #[ORM\Column(name'createdAt'type'datetime')]
  17.     private DateTime $createdAt;
  18.     #[ORM\ManyToOne(targetEntity'App\Entity\Vehicle'inversedBy'theft'fetch'EXTRA_LAZY')]
  19.     #[ORM\JoinColumn(nullabletrue)]
  20.     private ?Vehicle $vehicle;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private ?string $commune;
  23.     public function __construct() {
  24.         $this->createdAt = new DateTime();
  25.     }
  26.     public function __toString() {
  27.         return "#" $this->id;
  28.     }
  29.     /**
  30.      * Get id.
  31.      *
  32.      * @return int
  33.      */
  34.     public function getId()
  35.     {
  36.         return $this->id;
  37.     }
  38.     /**
  39.      * Get isDeleted.
  40.      *
  41.      * @return bool
  42.      */
  43.     public function getIsDeleted()
  44.     {
  45.         return $this->isDeleted;
  46.     }
  47.     /**
  48.      * Set isDeleted.
  49.      *
  50.      * @param bool $isDeleted
  51.      *
  52.      * @return VehicleTheft
  53.      */
  54.     public function setIsDeleted($isDeleted)
  55.     {
  56.         $this->isDeleted $isDeleted;
  57.         return $this;
  58.     }
  59.     /**
  60.      * Get createdAt.
  61.      *
  62.      * @return \DateTime
  63.      */
  64.     public function getCreatedAt()
  65.     {
  66.         return $this->createdAt;
  67.     }
  68.     /**
  69.      * Set createdAt.
  70.      *
  71.      * @param \DateTime $createdAt
  72.      *
  73.      * @return VehicleTheft
  74.      */
  75.     public function setCreatedAt($createdAt)
  76.     {
  77.         $this->createdAt $createdAt;
  78.         return $this;
  79.     }
  80.     /**
  81.      * Get commune.
  82.      *
  83.      * @return string|null
  84.      */
  85.     public function getCommune()
  86.     {
  87.         return $this->commune;
  88.     }
  89.     /**
  90.      * Set commune.
  91.      *
  92.      * @param string|null $commune
  93.      *
  94.      * @return VehicleTheft
  95.      */
  96.     public function setCommune($commune null)
  97.     {
  98.         $this->commune $commune;
  99.         return $this;
  100.     }
  101.     /**
  102.      * Get vehicle.
  103.      *
  104.      * @return \App\Entity\Vehicle|null
  105.      */
  106.     public function getVehicle()
  107.     {
  108.         return $this->vehicle;
  109.     }
  110.     /**
  111.      * Set vehicle.
  112.      *
  113.      * @param \App\Entity\Vehicle|null $vehicle
  114.      *
  115.      * @return VehicleTheft
  116.      */
  117.     public function setVehicle(\App\Entity\Vehicle $vehicle null)
  118.     {
  119.         $this->vehicle $vehicle;
  120.         return $this;
  121.     }
  122. }