src/Entity/CaracteristiqueVehicule.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CaracteristiqueVehiculeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CaracteristiqueVehiculeRepository::class)
  9.  */
  10. class CaracteristiqueVehicule
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="boolean", nullable=true)
  20.      */
  21.     private $isAirConditioned;
  22.     /**
  23.      * @ORM\Column(type="integer", nullable=true)
  24.      */
  25.     private $doorCount;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true)
  28.      */
  29.     private $seatCount;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=true)
  32.      */
  33.     private $speedLimit;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=GearboxType::class, inversedBy="caracteristiqueVehicules")
  36.      * @ORM\JoinColumn(nullable=true)
  37.      */
  38.     private $gearboxType;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=FuelType::class, inversedBy="caracteristiqueVehicules")
  41.      * @ORM\JoinColumn(nullable=true)
  42.      */
  43.     private $fuelType;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Product::class, mappedBy="caracteristiqueVehicule", cascade={"persist", "remove"})
  46.      */
  47.     private $products;
  48.     public function __construct()
  49.     {
  50.         $this->products = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getIsAirConditioned(): ?bool
  57.     {
  58.         return $this->isAirConditioned;
  59.     }
  60.     public function setIsAirConditioned(bool $isAirConditioned): self
  61.     {
  62.         $this->isAirConditioned $isAirConditioned;
  63.         return $this;
  64.     }
  65.     public function getDoorCount(): ?int
  66.     {
  67.         return $this->doorCount;
  68.     }
  69.     public function setDoorCount(int $doorCount): self
  70.     {
  71.         $this->doorCount $doorCount;
  72.         return $this;
  73.     }
  74.     public function getSeatCount(): ?int
  75.     {
  76.         return $this->seatCount;
  77.     }
  78.     public function setSeatCount(int $seatCount): self
  79.     {
  80.         $this->seatCount $seatCount;
  81.         return $this;
  82.     }
  83.     public function getSpeedLimit(): ?int
  84.     {
  85.         return $this->speedLimit;
  86.     }
  87.     public function setSpeedLimit(int $speedLimit): self
  88.     {
  89.         $this->speedLimit $speedLimit;
  90.         return $this;
  91.     }
  92.     public function getGearboxType(): ?GearboxType
  93.     {
  94.         return $this->gearboxType;
  95.     }
  96.     public function setGearboxType(?GearboxType $gearboxType): self
  97.     {
  98.         $this->gearboxType $gearboxType;
  99.         return $this;
  100.     }
  101.     public function getFuelType(): ?FuelType
  102.     {
  103.         return $this->fuelType;
  104.     }
  105.     public function setFuelType(?FuelType $fuelType): self
  106.     {
  107.         $this->fuelType $fuelType;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, Product>
  112.      */
  113.     public function getProducts(): Collection
  114.     {
  115.         return $this->products;
  116.     }
  117.     public function addProduct(Product $product): self
  118.     {
  119.         if (!$this->products->contains($product)) {
  120.             $this->products[] = $product;
  121.             $product->setCaracteristiqueVehicule($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeProduct(Product $product): self
  126.     {
  127.         if ($this->products->removeElement($product)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($product->getCaracteristiqueVehicule() === $this) {
  130.                 $product->setCaracteristiqueVehicule(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135. }