]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
Show untagged entries count on tag list
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index b5e35eff3848a69a8e0ee43e769a7fa55aee18b1..3a1f19b4ccad3adc761f6cff35c32c184859ce85 100644 (file)
@@ -115,6 +115,20 @@ class EntryRepository extends EntityRepository
             ->andWhere('size(e.tags) = 0');
     }
 
+    /**
+     * Retrieve the number of untagged entries for a user.
+     * 
+     * @param int $userId
+     * 
+     * @return int
+     */
+    public function countUntaggedEntriesByUser($userId)
+    {
+        return $this->getRawBuilderForUntaggedByUser($userId)
+            ->select('count(e.id)')
+            ->getSingleScalarResult();
+    }
+
     /**
      * Find Entries.
      *