apps/backend/src/Entity/Model.php line 16

  1. <?php
  2. namespace Backend\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Model
  6.  *
  7.  */
  8. #[ORM\Table(name'model')]
  9. #[ORM\Index(columns: ['brand_id'], name'fk_model_brand_idx')]
  10. #[ORM\Index(columns: ['vehicle_type_id'], name'fk_model_vehicle_type_idx')]
  11. #[ORM\Index(columns: ['vehicle_category_id'], name'fk_vehicle_category_idx')]
  12. #[ORM\Entity]
  13. class Model
  14. {
  15.     /**
  16.      * @var int
  17.      *
  18.      */
  19.     #[ORM\Column(name'id'type'integer'nullablefalse)]
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  22.     private $id;
  23.     #[ORM\Column(name'name'type'string'length100nullablefalse)]
  24.     private string $name;
  25.     #[ORM\JoinColumn(name'brand_id'referencedColumnName'id')]
  26.     #[ORM\ManyToOne(targetEntity'Brand')]
  27.     private Brand $brand;
  28.     #[ORM\JoinColumn(name'vehicle_type_id'referencedColumnName'id')]
  29.     #[ORM\ManyToOne(targetEntity'VehicleType')]
  30.     private VehicleType $vehicleType;
  31.     #[ORM\JoinColumn(name'vehicle_category_id'referencedColumnName'id')]
  32.     #[ORM\ManyToOne(targetEntity'VehicleCategory')]
  33.     private VehicleCategory $vehicleCategory;
  34.     public function __toString(): string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getName(): ?string
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function setName(string $name): self
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     public function getBrand(): ?Brand
  52.     {
  53.         return $this->brand;
  54.     }
  55.     public function setBrand(?Brand $brand): self
  56.     {
  57.         $this->brand $brand;
  58.         return $this;
  59.     }
  60.     public function getVehicleType(): ?VehicleType
  61.     {
  62.         return $this->vehicleType;
  63.     }
  64.     public function setVehicleType(?VehicleType $vehicleType): self
  65.     {
  66.         $this->vehicleType $vehicleType;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return VehicleCategory
  71.      */
  72.     public function getVehicleCategory(): VehicleCategory
  73.     {
  74.         return $this->vehicleCategory;
  75.     }
  76.     public function setVehicleCategory(VehicleCategory $vehicleCategory): self
  77.     {
  78.         $this->vehicleCategory $vehicleCategory;
  79.         return $this;
  80.     }
  81. }