]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
Fixed repository to retrieve articles
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index f2c73bbfffcdfbd99ee629e1cf449fde626f67ba..23d1e37e2deda7aa25a53823a417ece9741edf5f 100644 (file)
@@ -52,14 +52,21 @@ class EntryRepository extends EntityRepository
      */
     public function getBuilderForSameDomainByUser($userId, $entryId)
     {
-        dump($entryId);die;
-
-        $
+        $queryBuilder = $this->createQueryBuilder('e');
 
         return $this
             ->getSortedQueryBuilderByUser($userId)
-            ->andWhere('e.isArchived = false')
-        ;
+            ->andWhere('e.id <> :entryId')->setParameter('entryId', $entryId)
+            ->andWhere(
+                $queryBuilder->expr()->in(
+                    'e.domainName',
+                    $this
+                        ->createQueryBuilder('e2')
+                        ->select('e2.domainName')
+                        ->where('e2.id = :entryId')->setParameter('entryId', $entryId)
+                        ->getDQL()
+                )
+            );
     }
 
     /**