<?php
namespace App\Entity;
use App\Repository\CaracteristiqueVehiculeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CaracteristiqueVehiculeRepository::class)
*/
class CaracteristiqueVehicule
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAirConditioned;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $doorCount;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $seatCount;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $speedLimit;
/**
* @ORM\ManyToOne(targetEntity=GearboxType::class, inversedBy="caracteristiqueVehicules")
* @ORM\JoinColumn(nullable=true)
*/
private $gearboxType;
/**
* @ORM\ManyToOne(targetEntity=FuelType::class, inversedBy="caracteristiqueVehicules")
* @ORM\JoinColumn(nullable=true)
*/
private $fuelType;
/**
* @ORM\OneToMany(targetEntity=Product::class, mappedBy="caracteristiqueVehicule", cascade={"persist", "remove"})
*/
private $products;
public function __construct()
{
$this->products = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIsAirConditioned(): ?bool
{
return $this->isAirConditioned;
}
public function setIsAirConditioned(bool $isAirConditioned): self
{
$this->isAirConditioned = $isAirConditioned;
return $this;
}
public function getDoorCount(): ?int
{
return $this->doorCount;
}
public function setDoorCount(int $doorCount): self
{
$this->doorCount = $doorCount;
return $this;
}
public function getSeatCount(): ?int
{
return $this->seatCount;
}
public function setSeatCount(int $seatCount): self
{
$this->seatCount = $seatCount;
return $this;
}
public function getSpeedLimit(): ?int
{
return $this->speedLimit;
}
public function setSpeedLimit(int $speedLimit): self
{
$this->speedLimit = $speedLimit;
return $this;
}
public function getGearboxType(): ?GearboxType
{
return $this->gearboxType;
}
public function setGearboxType(?GearboxType $gearboxType): self
{
$this->gearboxType = $gearboxType;
return $this;
}
public function getFuelType(): ?FuelType
{
return $this->fuelType;
}
public function setFuelType(?FuelType $fuelType): self
{
$this->fuelType = $fuelType;
return $this;
}
/**
* @return Collection<int, Product>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->setCaracteristiqueVehicule($this);
}
return $this;
}
public function removeProduct(Product $product): self
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getCaracteristiqueVehicule() === $this) {
$product->setCaracteristiqueVehicule(null);
}
}
return $this;
}
}