src/Entity/BCType.php line 11
<?php
namespace App\Entity;
use App\Repository\BCTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BCTypeRepository::class)]
class BCType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'BCTypes')]
#[ORM\JoinColumn(nullable: false)]
private ?BCFamille $BCFamille = null;
#[ORM\OneToMany(mappedBy: 'BCType', targetEntity: BCModele::class, orphanRemoval: true)]
private Collection $BCModeles;
public function __construct()
{
$this->BCModeles = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getBCFamille(): ?BCFamille
{
return $this->BCFamille;
}
public function setBCFamille(?BCFamille $BCFamille): self
{
$this->BCFamille = $BCFamille;
return $this;
}
/**
* @return Collection<int, BCModele>
*/
public function getBCModeles(): Collection
{
return $this->BCModeles;
}
public function addBCModele(BCModele $bCModele): self
{
if (!$this->BCModeles->contains($bCModele)) {
$this->BCModeles->add($bCModele);
$bCModele->setBCType($this);
}
return $this;
}
public function removeBCModele(BCModele $bCModele): self
{
if ($this->BCModeles->removeElement($bCModele)) {
// set the owning side to null (unless already changed)
if ($bCModele->getBCType() === $this) {
$bCModele->setBCType(null);
}
}
return $this;
}
}