src\Entity\Organisateur.php line 10

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. #[ORM\Entity(repositoryClass\App\Repository\OrganisateurRepository::class)]
  7. class Organisateur
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255)]
  14.     private $nom;
  15.     #[ORM\Column(type'text'nullabletrue)]
  16.     private $description;
  17.     #[ORM\Column(type'string'length255nullabletrue)]
  18.     private $logo;
  19.     #[ORM\ManyToMany(targetEntity\App\Entity\Formation::class, mappedBy'organisateur')]
  20.     private $formations;
  21.     public function __construct()
  22.     {
  23.         $this->formations = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getNom(): ?string
  30.     {
  31.         return $this->nom;
  32.     }
  33.     public function setNom(string $nom): self
  34.     {
  35.         $this->nom $nom;
  36.         return $this;
  37.     }
  38.     public function getDescription(): ?string
  39.     {
  40.         return $this->description;
  41.     }
  42.     public function setDescription(?string $description): self
  43.     {
  44.         $this->description $description;
  45.         return $this;
  46.     }
  47.     public function getLogo(): ?string
  48.     {
  49.         return $this->logo;
  50.     }
  51.     public function setLogo(?string $logo): self
  52.     {
  53.         $this->logo $logo;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection|Formation[]
  58.      */
  59.     public function getFormations(): Collection
  60.     {
  61.         return $this->formations;
  62.     }
  63.     public function addFormation(Formation $formation): self
  64.     {
  65.         if (!$this->formations->contains($formation)) {
  66.             $this->formations[] = $formation;
  67.             $formation->addOrganisateur($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removeFormation(Formation $formation): self
  72.     {
  73.         if ($this->formations->contains($formation)) {
  74.             $this->formations->removeElement($formation);
  75.             $formation->removeOrganisateur($this);
  76.         }
  77.         return $this;
  78.     }
  79. }