src/Entity/CategorieElearning.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategorieElearningRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCategorieElearningRepository::class)]
  8. class CategorieElearning
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255nullabletrue)]
  15.     private ?string $libelle null;
  16.     #[ORM\OneToMany(mappedBy'categorie'targetEntityFormationElearning::class,cascade: ['remove'])]
  17.     private Collection $formationElearnings;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $slug null;
  20.     public function __construct()
  21.     {
  22.         $this->formationElearnings = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getLibelle(): ?string
  29.     {
  30.         return $this->libelle;
  31.     }
  32.     public function setLibelle(?string $libelle): self
  33.     {
  34.         $this->libelle $libelle;
  35.         return $this;
  36.     }
  37.     /**
  38.      * @return Collection<int, FormationElearning>
  39.      */
  40.     public function getFormationElearnings(): Collection
  41.     {
  42.         return $this->formationElearnings;
  43.     }
  44.     public function addFormationElearning(FormationElearning $formationElearning): self
  45.     {
  46.         if (!$this->formationElearnings->contains($formationElearning)) {
  47.             $this->formationElearnings->add($formationElearning);
  48.             $formationElearning->setCategorie($this);
  49.         }
  50.         return $this;
  51.     }
  52.     public function removeFormationElearning(FormationElearning $formationElearning): self
  53.     {
  54.         if ($this->formationElearnings->removeElement($formationElearning)) {
  55.             // set the owning side to null (unless already changed)
  56.             if ($formationElearning->getCategorie() === $this) {
  57.                 $formationElearning->setCategorie(null);
  58.             }
  59.         }
  60.         return $this;
  61.     }
  62.     public function getSlug(): ?string
  63.     {
  64.         return $this->slug;
  65.     }
  66.     public function setSlug(?string $slug): self
  67.     {
  68.         $this->slug $slug;
  69.         return $this;
  70.     }
  71. }