<?php
namespace App\Entity;
use App\Repository\ClubManagerRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ClubManagerRepository::class)]
class ClubManager
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(cascade: ["persist"], inversedBy: 'clubManagers')]
#[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")]
private ?Club $club = null;
#[ORM\ManyToOne(cascade: ["persist"], inversedBy: 'clubManagers')]
#[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")]
private ?User $user = null;
public function __toString(): string
{
return $this->club->getName() . ' --> ' . $this->user->getShortname();
}
public function getId(): ?int
{
return $this->id;
}
public function getClub(): ?Club
{
return $this->club;
}
public function setClub(?Club $club): static
{
$this->club = $club;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
}