<?phpnamespace App\Entity;use App\Repository\SessionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SessionRepository::class) */class SessionCollection{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=Site::class, inversedBy="sessions") * @ORM\JoinColumn(nullable=false) */ private $site; /** * @ORM\ManyToOne(targetEntity=Formation::class, inversedBy="sessions") * @ORM\JoinColumn(nullable=false) */ private $formation; /** * @ORM\OneToMany(targetEntity=SessionMasse::class, mappedBy="sessionCollection", orphanRemoval=true) */ private $sessions; public function __construct() { $this->sessions = new ArrayCollection(); } public function getSite(): ?Site { return $this->site; } public function setSite(?Site $site): self { $this->site = $site; return $this; } public function getFormation(): ?Formation { return $this->formation; } public function setFormation(?Formation $formation): self { $this->formation = $formation; return $this; } /** * @return Collection<int, SessionMasse> */ public function getSessions(): Collection { return $this->sessions; } public function addSession(SessionMasse $session): self { if (!$this->sessions->contains($session)) { $this->sessions[] = $session; } return $this; } public function removeSession(SessionMasse $sessions): self { $this->sessions->removeElement($sessions); return $this; } }