src/Entity/CategorieFormation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategorieFormationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CategorieFormationRepository::class)
  9.  */
  10. class CategorieFormation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $wording;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Formation::class, mappedBy="categorieformation")
  24.      */
  25.     private $formations
  26.    
  27.     public function __construct()
  28.     {
  29.         $this->formations = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getWording(): ?string
  36.     {
  37.         return $this->wording;
  38.     }
  39.     public function setWording(string $wording): self
  40.     {
  41.         $this->wording $wording;
  42.         return $this;
  43.     }
  44.     /**
  45.      * @return Collection<int, Formation>
  46.      */
  47.     public function getFormations(): Collection
  48.     {
  49.         return $this->formations;
  50.     }
  51.     public function addFormation(Formation $formation): self
  52.     {
  53.         if (!$this->formations->contains($formation)) {
  54.             $this->formations[] = $formation;
  55.             $formation->setCategorieformation($this);
  56.         }
  57.         return $this;
  58.     }
  59.     public function removeFormation(Formation $formation): self
  60.     {
  61.         if ($this->formations->removeElement($formation)) {
  62.             // set the owning side to null (unless already changed)
  63.             if ($formation->getCategorieformation() === $this) {
  64.                 $formation->setCategorieformation(null);
  65.             }
  66.         }
  67.         return $this;
  68.     }
  69. }