aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-01-15 15:21:43 +0100
committerJeremy Benoist <j0k3r@users.noreply.github.com>2016-01-15 15:21:43 +0100
commit790573d45899504bdecd2573c8f64018e23b139e (patch)
tree58715ecffdaa63660f30447e64fcf892d06a223f /src/Wallabag/CoreBundle/Repository/EntryRepository.php
parent9ee44a109a93ce8af5a85fb1ba349d390623454d (diff)
parent5c072d2b57b2b5f95b25411909ac8a6af2ef6ebe (diff)
downloadwallabag-790573d45899504bdecd2573c8f64018e23b139e.tar.gz
wallabag-790573d45899504bdecd2573c8f64018e23b139e.tar.zst
wallabag-790573d45899504bdecd2573c8f64018e23b139e.zip
Merge pull request #1560 from wallabag/v2-quickstart
Fix #1501 Quickstart for beginners
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index c6763a40..a16be9e0 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -122,6 +122,8 @@ class EntryRepository extends EntityRepository
122 /** 122 /**
123 * Fetch an entry with a tag. Only used for tests. 123 * Fetch an entry with a tag. Only used for tests.
124 * 124 *
125 * @param int $userId
126 *
125 * @return Entry 127 * @return Entry
126 */ 128 */
127 public function findOneWithTags($userId) 129 public function findOneWithTags($userId)
@@ -248,4 +250,21 @@ class EntryRepository extends EntityRepository
248 250
249 return false; 251 return false;
250 } 252 }
253
254 /**
255 * Count all entries for a user.
256 *
257 * @param int $userId
258 *
259 * @return integer
260 */
261 public function countAllEntriesByUsername($userId)
262 {
263 $qb = $this->createQueryBuilder('e')
264 ->select('count(e)')
265 ->where('e.user=:userId')->setParameter('userId', $userId)
266 ;
267
268 return $qb->getQuery()->getSingleScalarResult();
269 }
251} 270}