<?php
namespace App\Entity;
use App\Repository\CompetencesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CompetencesRepository::class)]
class Competences
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 50)]
private $libelle;
#[ORM\Column(type: 'string', length: 50)]
private $categorie;
#[ORM\Column(type: 'integer')]
private $niveau_competence;
#[ORM\ManyToMany(targetEntity: Consultants::class, mappedBy: 'competence')]
private $consultants;
#[ORM\ManyToMany(targetEntity: Missions::class, mappedBy: 'competence')]
private $missions;
public function __construct()
{
$this->consultants = new ArrayCollection();
$this->missions = 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 getCategorie(): ?string
{
return $this->categorie;
}
public function setCategorie(string $categorie): self
{
$this->categorie = $categorie;
return $this;
}
public function getNiveauCompetence(): ?int
{
return $this->niveau_competence;
}
public function setNiveauCompetence(int $niveau_competence): self
{
$this->niveau_competence = $niveau_competence;
return $this;
}
/**
* @return Collection<int, Missions>
*/
public function getMissions(): Collection
{
return $this->missions;
}
public function addMission(Missions $mission): self
{
if (!$this->missions->contains($mission)) {
$this->missions[] = $mission;
$mission->addCompetence($this);
}
return $this;
}
public function removeMission(Missions $mission): self
{
if ($this->missions->removeElement($mission)) {
$mission->removeCompetence($this);
}
return $this;
}
}