src/Entity/BCModele.php line 11
<?php
namespace App\Entity;
use App\Repository\BCModeleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BCModeleRepository::class)]
class BCModele
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'BCModeles')]
#[ORM\JoinColumn(nullable: false)]
private ?BCType $BCType = null;
#[ORM\OneToMany(mappedBy: 'BCModele', targetEntity: BCFacteur::class, orphanRemoval: true)]
private Collection $BCFacteurs;
public function __construct()
{
$this->BCFacteurs = 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 getBCType(): ?BCType
{
return $this->BCType;
}
public function setBCType(?BCType $BCType): self
{
$this->BCType = $BCType;
return $this;
}
public function getLastFacteur(): ?BCFacteur
{
return $this->BCFacteurs->last();
}
/**
* @return Collection<int, BCFacteur>
*/
public function getBCFacteurs(): Collection
{
return $this->BCFacteurs;
}
public function addBCFacteur(BCFacteur $bCFacteur): self
{
if (!$this->BCFacteurs->contains($bCFacteur)) {
$this->BCFacteurs->add($bCFacteur);
$bCFacteur->setBCModele($this);
}
return $this;
}
public function removeBCFacteur(BCFacteur $bCFacteur): self
{
if ($this->BCFacteurs->removeElement($bCFacteur)) {
// set the owning side to null (unless already changed)
if ($bCFacteur->getBCModele() === $this) {
$bCFacteur->setBCModele(null);
}
}
return $this;
}
}