entityManager = $entityManager; } public function getEntityManager(?string $name = null): EntityManagerInterface { if ($name !== null) { throw InvalidLoader::noMultipleEntityManagers($this); } return $this->entityManager; } }