aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-01-09 14:34:49 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2016-01-15 15:01:30 +0100
commit5c072d2b57b2b5f95b25411909ac8a6af2ef6ebe (patch)
tree1224140aff058371464d2737a6a3d6ae17f34d06 /src/Wallabag/CoreBundle/Repository/EntryRepository.php
parent0aafb8dfcb098ae586dc87f3487b4948f8ae2314 (diff)
downloadwallabag-5c072d2b57b2b5f95b25411909ac8a6af2ef6ebe.tar.gz
wallabag-5c072d2b57b2b5f95b25411909ac8a6af2ef6ebe.tar.zst
wallabag-5c072d2b57b2b5f95b25411909ac8a6af2ef6ebe.zip
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}