src/Entity/GeneralSkill.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * GeneralSkill
  8.  *
  9.  * @ORM\Table(name="general_skill")
  10.  * @ORM\Entity
  11.  */
  12. class GeneralSkill
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="libelle", type="string", length=255, nullable=false)
  26.      */
  27.     private $libelle;
  28.     /**
  29.      * @var \Doctrine\Common\Collections\Collection
  30.      *
  31.      * @ORM\ManyToMany(targetEntity="Expert", mappedBy="generalSkill")
  32.      */
  33.     private $expert;
  34.     /**
  35.      * Constructor
  36.      */
  37.     public function __construct()
  38.     {
  39.         $this->expert = new \Doctrine\Common\Collections\ArrayCollection();
  40.     }
  41.     public function __toString() { return $this->libelle;}
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getLibelle(): ?string
  47.     {
  48.         return $this->libelle;
  49.     }
  50.     public function setLibelle(string $libelle): self
  51.     {
  52.         $this->libelle $libelle;
  53.         return $this;
  54.     }
  55.     /**
  56.      * @return Collection<int, Expert>
  57.      */
  58.     public function getExpert(): Collection
  59.     {
  60.         return $this->expert;
  61.     }
  62.     public function addExpert(Expert $expert): self
  63.     {
  64.         if (!$this->expert->contains($expert)) {
  65.             $this->expert[] = $expert;
  66.             $expert->addGeneralSkill($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeExpert(Expert $expert): self
  71.     {
  72.         if ($this->expert->removeElement($expert)) {
  73.             $expert->removeGeneralSkill($this);
  74.         }
  75.         return $this;
  76.     }
  77. }