<?php
namespace App\Entity;
use App\Repository\FiliereRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FiliereRepository::class)]
class Filiere
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $libelle = null;
#[ORM\OneToMany(mappedBy: 'refFiliere', targetEntity: Sequence::class)]
private Collection $refSequences;
public function __construct()
{
$this->refSequences = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function __toString(): string
{
return $this->getLibelle();// TODO: Implement __toString() method.
}
/**
* @return Collection<int, Sequence>
*/
public function getRefSequences(): Collection
{
return $this->refSequences;
}
public function addRefSequence(Sequence $refSequence): self
{
if (!$this->refSequences->contains($refSequence)) {
$this->refSequences->add($refSequence);
$refSequence->setRefFiliere($this);
}
return $this;
}
public function removeRefSequence(Sequence $refSequence): self
{
if ($this->refSequences->removeElement($refSequence)) {
// set the owning side to null (unless already changed)
if ($refSequence->getRefFiliere() === $this) {
$refSequence->setRefFiliere(null);
}
}
return $this;
}
}