]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
Add untagged entries
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index fada40bbd4c5c8e24010c0b2140e23a6b03ecb35..e5c21679935a51035a9df97a88486a27a6864e0e 100644 (file)
@@ -84,6 +84,22 @@ class EntryRepository extends EntityRepository
         ;
     }
 
+    /**
+     * Retrieves untagged entries for a user.
+     *
+     * @param int $userId
+     *
+     * @return QueryBuilder
+     */
+    public function getBuilderForUntaggedByUser($userId)
+    {
+        return $this
+            ->getBuilderByUser($userId)
+            ->leftJoin('e.tags', 't')
+            ->groupBy('e.id')
+            ->having('count(t.id) = 0');
+    }
+
     /**
      * Find Entries.
      *