src/Entity/Jeux.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\JeuxRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=JeuxRepository::class)
  9.  */
  10. class Jeux
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=100, nullable=true)
  20.      */
  21.     private $nom;
  22.     /**
  23.      * @ORM\ManyToMany(targetEntity=Joueurs::class, inversedBy="listJeux")
  24.      */
  25.     private $joueurs;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $slug;
  30.     public function __construct()
  31.     {
  32.         $this->joueurs = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getNom(): ?string
  39.     {
  40.         return $this->nom;
  41.     }
  42.     public function setNom(?string $nom): self
  43.     {
  44.         $this->nom = $nom;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, Joueurs>
  49.      */
  50.     public function getJoueurs(): Collection
  51.     {
  52.         return $this->joueurs;
  53.     }
  54.     public function addJoueur(Joueurs $joueur): self
  55.     {
  56.         if (!$this->joueurs->contains($joueur)) {
  57.             $this->joueurs[] = $joueur;
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeJoueur(Joueurs $joueur): self
  62.     {
  63.         $this->joueurs->removeElement($joueur);
  64.         return $this;
  65.     }
  66.     public function getSlug(): ?string
  67.     {
  68.         return $this->slug;
  69.     }
  70.     public function setSlug(?string $slug): self
  71.     {
  72.         $this->slug = $slug;
  73.         return $this;
  74.     }
  75. }