src/Entity/SavoirTechnologique.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SavoirTechnologiqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassSavoirTechnologiqueRepository::class)]
  8. class SavoirTechnologique
  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\ManyToMany(targetEntityCompetence::class, inversedBy'refSavoirTechnologiques')]
  17.     private Collection $refCompetences;
  18.     #[ORM\ManyToMany(targetEntitySequence::class, mappedBy'refSavoirTechnologique')]
  19.     private Collection $refSequences;
  20.     public function __construct()
  21.     {
  22.         $this->refCompetences = new ArrayCollection();
  23.         $this->refSequences = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getLibelle(): ?string
  30.     {
  31.         return $this->libelle;
  32.     }
  33.     public function setLibelle(string $libelle): self
  34.     {
  35.         $this->libelle $libelle;
  36.         return $this;
  37.     }
  38.     /**
  39.      * @return Collection<int, Competence>
  40.      */
  41.     public function getRefCompetences(): Collection
  42.     {
  43.         return $this->refCompetences;
  44.     }
  45.     public function addRefCompetence(Competence $refCompetence): self
  46.     {
  47.         if (!$this->refCompetences->contains($refCompetence)) {
  48.             $this->refCompetences->add($refCompetence);
  49.         }
  50.         return $this;
  51.     }
  52.     public function removeRefCompetence(Competence $refCompetence): self
  53.     {
  54.         $this->refCompetences->removeElement($refCompetence);
  55.         return $this;
  56.     }
  57.     public function __toString(): string
  58.     {
  59.         return $this->getLibelle();// TODO: Implement __toString() method.
  60.     }
  61.     /**
  62.      * @return Collection<int, Sequence>
  63.      */
  64.     public function getRefSequences(): Collection
  65.     {
  66.         return $this->refSequences;
  67.     }
  68.     public function addRefSequence(Sequence $refSequence): self
  69.     {
  70.         if (!$this->refSequences->contains($refSequence)) {
  71.             $this->refSequences->add($refSequence);
  72.             $refSequence->addRefSavoirTechnologique($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeRefSequence(Sequence $refSequence): self
  77.     {
  78.         if ($this->refSequences->removeElement($refSequence)) {
  79.             $refSequence->removeRefSavoirTechnologique($this);
  80.         }
  81.         return $this;
  82.     }
  83. }