<?php
namespace App\Entity;
use App\Repository\FuelTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FuelTypeRepository::class)
*/
class FuelType
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=50)
*/
private $fuel;
/**
* @ORM\OneToMany(targetEntity=CaracteristiqueVehicule::class, mappedBy="fuelType")
*/
private $caracteristiqueVehicules;
public function __construct()
{
$this->caracteristiqueVehicules = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFuel(): ?string
{
return $this->fuel;
}
public function setFuel(string $fuel): self
{
$this->fuel = $fuel;
return $this;
}
/**
* @return Collection<int, CaracteristiqueVehicule>
*/
public function getCaracteristiqueVehicules(): Collection
{
return $this->caracteristiqueVehicules;
}
public function addCaracteristiqueVehicule(CaracteristiqueVehicule $caracteristiqueVehicule): self
{
if (!$this->caracteristiqueVehicules->contains($caracteristiqueVehicule)) {
$this->caracteristiqueVehicules[] = $caracteristiqueVehicule;
$caracteristiqueVehicule->setFuelType($this);
}
return $this;
}
public function removeCaracteristiqueVehicule(CaracteristiqueVehicule $caracteristiqueVehicule): self
{
if ($this->caracteristiqueVehicules->removeElement($caracteristiqueVehicule)) {
// set the owning side to null (unless already changed)
if ($caracteristiqueVehicule->getFuelType() === $this) {
$caracteristiqueVehicule->setFuelType(null);
}
}
return $this;
}
}