src/Entity/Filiere.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FiliereRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassFiliereRepository::class)]
  8. class Filiere
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $libelle null;
  16.     #[ORM\OneToMany(mappedBy'refFiliere'targetEntitySequence::class)]
  17.     private Collection $refSequences;
  18.     public function __construct()
  19.     {
  20.         $this->refSequences = new ArrayCollection();
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getLibelle(): ?string
  27.     {
  28.         return $this->libelle;
  29.     }
  30.     public function setLibelle(string $libelle): self
  31.     {
  32.         $this->libelle $libelle;
  33.         return $this;
  34.     }
  35.     public function __toString(): string
  36.     {
  37.         return $this->getLibelle();// TODO: Implement __toString() method.
  38.     }
  39.     /**
  40.      * @return Collection<int, Sequence>
  41.      */
  42.     public function getRefSequences(): Collection
  43.     {
  44.         return $this->refSequences;
  45.     }
  46.     public function addRefSequence(Sequence $refSequence): self
  47.     {
  48.         if (!$this->refSequences->contains($refSequence)) {
  49.             $this->refSequences->add($refSequence);
  50.             $refSequence->setRefFiliere($this);
  51.         }
  52.         return $this;
  53.     }
  54.     public function removeRefSequence(Sequence $refSequence): self
  55.     {
  56.         if ($this->refSequences->removeElement($refSequence)) {
  57.             // set the owning side to null (unless already changed)
  58.             if ($refSequence->getRefFiliere() === $this) {
  59.                 $refSequence->setRefFiliere(null);
  60.             }
  61.         }
  62.         return $this;
  63.     }
  64. }