private function createRepository(EntityManagerInterface
$entityManager,
$entityName) { $metadata =
$entityManager->
getClassMetadata($entityName);
/** @var class-string<ObjectRepository<TEntityClass>>|null $repositoryClassName */
$repositoryClassName =
$metadata->customRepositoryClassName;
if ($repositoryClassName === null
) { $repositoryClassName =
$entityManager->
getConfiguration()->
getDefaultRepositoryClassName();
} /** @var class-string<ObjectRepository<TEntityClass>> $repositoryClassName */
$repositoryClassName =
$this->hookManager->
getProxy($repositoryClassName);
return new $repositoryClassName($entityManager,
$metadata);
}}