]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
Update language in Entry model, and add index
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 7772e0b78a7c29387278ddcfd138a003187d408e..d967598263c5e1237f7d7e2a2ea6f1a89df3a4ae 100644 (file)
@@ -129,6 +129,21 @@ class EntryRepository extends EntityRepository
             ->andWhere('t.id is null');
     }
 
+    /**
+     * Retrieve the number of untagged entries for a user.
+     *
+     * @param int $userId
+     *
+     * @return int
+     */
+    public function countUntaggedEntriesByUser($userId)
+    {
+        return (int) $this->getRawBuilderForUntaggedByUser($userId)
+            ->select('count(e.id)')
+            ->getQuery()
+            ->getSingleScalarResult();
+    }
+
     /**
      * Find Entries.
      *
@@ -345,7 +360,7 @@ class EntryRepository extends EntityRepository
      * @param string $url
      * @param int    $userId
      *
-     * @return Entry|bool
+     * @return Entry|false
      */
     public function findByUrlAndUserId($url, $userId)
     {
@@ -362,7 +377,7 @@ class EntryRepository extends EntityRepository
      * @param string $hashedUrl Url hashed using sha1
      * @param int    $userId
      *
-     * @return Entry|bool
+     * @return Entry|false
      */
     public function findByHashedUrlAndUserId($hashedUrl, $userId)
     {