src/Entity/Coach.php line 11
<?phpnamespace App\Entity;use App\Repository\CoachRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CoachRepository::class)]class Coach{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]private ?string $nom = null;#[ORM\OneToMany(mappedBy: 'coach', targetEntity: User::class)]private Collection $users;public function __construct(){$this->users = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getNom(): ?string{return $this->nom;}public function setNom(?string $nom): static{$this->nom = $nom;return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): static{if (!$this->users->contains($user)) {$this->users->add($user);$user->setCoach($this);}return $this;}public function removeUser(User $user): static{if ($this->users->removeElement($user)) {// set the owning side to null (unless already changed)if ($user->getCoach() === $this) {$user->setCoach(null);}}return $this;}}