]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
WIP
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 9bda4e15e81fcfd8d7e33635607fefa7db01c723..4bbd05ff1b8a23ec753c895751208dde684c6d4d 100644 (file)
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Repository;
 
 use Doctrine\ORM\EntityRepository;
 use Doctrine\ORM\Query;
+use Doctrine\ORM\QueryBuilder;
 use Pagerfanta\Adapter\DoctrineORMAdapter;
 use Pagerfanta\Pagerfanta;
 use Wallabag\CoreBundle\Entity\Tag;
@@ -89,7 +90,7 @@ class EntryRepository extends EntityRepository
      *
      * @param int    $userId
      * @param string $term
-     * @param strint $currentRoute
+     * @param string $currentRoute
      *
      * @return QueryBuilder
      */
@@ -414,4 +415,15 @@ class EntryRepository extends EntityRepository
             ->getQuery()
             ->getResult();
     }
+
+    /**
+     * @param $userId
+     * @return QueryBuilder
+     */
+    public function getBuilderForRecommendationsByUser($userId)
+    {
+        return $this->getBuilderByUser($userId)
+            ->andWhere('e.recommended = true')
+            ;
+    }
 }