<?php
namespace App\Entity;
use App\Repository\GearboxTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=GearboxTypeRepository::class)
*/
class GearboxType
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=50)
*/
private $type;
/**
* @ORM\OneToMany(targetEntity=CaracteristiqueVehicule::class, mappedBy="gearboxType")
*/
private $caracteristiqueVehicules;
public function __construct()
{
$this->caracteristiqueVehicules = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
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->setGearboxType($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->getGearboxType() === $this) {
$caracteristiqueVehicule->setGearboxType(null);
}
}
return $this;
}
}