From: Raphaƫl Gertz Date: Thu, 26 Nov 2026 15:54:56 +0000 (+0100) Subject: Match doctrine orm entityrepository prototype X-Git-Tag: 0.0.2~6 X-Git-Url: https://git.rapsys.eu/blogbundle/commitdiff_plain/6f10900dc329f1f3ea0246fa358e5fb7133a0cd0 Match doctrine orm entityrepository prototype --- diff --git a/Factory/RepositoryFactory.php b/Factory/RepositoryFactory.php index 893b03b..a795410 100644 --- a/Factory/RepositoryFactory.php +++ b/Factory/RepositoryFactory.php @@ -13,7 +13,7 @@ namespace Rapsys\BlogBundle\Factory; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Repository\RepositoryFactory as RepositoryFactoryInterface; -use Doctrine\Persistence\ObjectRepository; +use Doctrine\ORM\EntityRepository; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Routing\RouterInterface; use Symfony\Contracts\Translation\TranslatorInterface; @@ -106,7 +106,7 @@ final class RepositoryFactory implements RepositoryFactoryInterface { /** * {@inheritdoc} */ - public function getRepository(EntityManagerInterface $entityManager, mixed $entityName): ObjectRepository { + public function getRepository(EntityManagerInterface $entityManager, mixed $entityName): EntityRepository { //Set repository hash $repositoryHash = $entityManager->getClassMetadata($entityName)->getName() . spl_object_hash($entityManager); @@ -126,7 +126,7 @@ final class RepositoryFactory implements RepositoryFactoryInterface { * @param EntityManagerInterface $entityManager The EntityManager instance. * @param string $entityName The name of the entity. */ - private function createRepository(EntityManagerInterface $entityManager, string $entityName): ObjectRepository { + private function createRepository(EntityManagerInterface $entityManager, string $entityName): EntityRepository { //Get class metadata $metadata = $entityManager->getClassMetadata($entityName);