<?php
namespace App\Entity;
use App\Repository\JeuxRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=JeuxRepository::class)
*/
class Jeux
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $nom;
/**
* @ORM\ManyToMany(targetEntity=Joueurs::class, inversedBy="listJeux")
*/
private $joueurs;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
public function __construct()
{
$this->joueurs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
/**
* @return Collection<int, Joueurs>
*/
public function getJoueurs(): Collection
{
return $this->joueurs;
}
public function addJoueur(Joueurs $joueur): self
{
if (!$this->joueurs->contains($joueur)) {
$this->joueurs[] = $joueur;
}
return $this;
}
public function removeJoueur(Joueurs $joueur): self
{
$this->joueurs->removeElement($joueur);
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
}