]> Raphaël G. Git Repositories - blogbundle/commitdiff
Match doctrine orm entityrepository prototype
authorRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 15:54:56 +0000 (16:54 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 15:54:56 +0000 (16:54 +0100)
Factory/RepositoryFactory.php

index 893b03b6f1fe0edc3ba7d5b51a84aa95d24a3ab7..a795410e2779d1860e800f1ed99ccede8c0f7a99 100644 (file)
@@ -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);