src/Entity/Competences.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CompetencesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCompetencesRepository::class)]
  8. class Competences
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length50)]
  15.     private $libelle;
  16.     #[ORM\Column(type'string'length50)]
  17.     private $categorie;
  18.     #[ORM\Column(type'integer')]
  19.     private $niveau_competence;
  20.     #[ORM\ManyToMany(targetEntityConsultants::class, mappedBy'competence')]
  21.     private $consultants;
  22.     #[ORM\ManyToMany(targetEntityMissions::class, mappedBy'competence')]
  23.     private $missions;
  24.     public function __construct()
  25.     {
  26.         $this->consultants = new ArrayCollection();
  27.         $this->missions = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getLibelle(): ?string
  34.     {
  35.         return $this->libelle;
  36.     }
  37.     public function setLibelle(string $libelle): self
  38.     {
  39.         $this->libelle $libelle;
  40.         return $this;
  41.     }
  42.     public function getCategorie(): ?string
  43.     {
  44.         return $this->categorie;
  45.     }
  46.     public function setCategorie(string $categorie): self
  47.     {
  48.         $this->categorie $categorie;
  49.         return $this;
  50.     }
  51.     public function getNiveauCompetence(): ?int
  52.     {
  53.         return $this->niveau_competence;
  54.     }
  55.     public function setNiveauCompetence(int $niveau_competence): self
  56.     {
  57.         $this->niveau_competence $niveau_competence;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, Missions>
  62.      */
  63.     public function getMissions(): Collection
  64.     {
  65.         return $this->missions;
  66.     }
  67.     public function addMission(Missions $mission): self
  68.     {
  69.         if (!$this->missions->contains($mission)) {
  70.             $this->missions[] = $mission;
  71.             $mission->addCompetence($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeMission(Missions $mission): self
  76.     {
  77.         if ($this->missions->removeElement($mission)) {
  78.             $mission->removeCompetence($this);
  79.         }
  80.         return $this;
  81.     }
  82. }