aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-08-08 19:48:47 +0200
committerGitHub <noreply@github.com>2017-08-08 19:48:47 +0200
commit86ecd2b543e0f63609213ff45665fef94e38c681 (patch)
treebbd2709f61167882ca2b023ade4f037d249fd2b8 /src/Wallabag/CoreBundle/Repository/EntryRepository.php
parentaff1dd4ff13f541001832cfb009d6f8854ff978d (diff)
parent935e9fffb4083f83e86c4e97a32bc2d9bccd677f (diff)
downloadwallabag-86ecd2b543e0f63609213ff45665fef94e38c681.tar.gz
wallabag-86ecd2b543e0f63609213ff45665fef94e38c681.tar.zst
wallabag-86ecd2b543e0f63609213ff45665fef94e38c681.zip
Merge pull request #3314 from nclsHart/fix-3313
Reduce number of queries on tag list
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 7f35bb9a..d70d6ca6 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -330,26 +330,6 @@ class EntryRepository extends EntityRepository
330 } 330 }
331 331
332 /** 332 /**
333 * Count all entries for a tag and a user.
334 *
335 * @param int $userId
336 * @param int $tagId
337 *
338 * @return int
339 */
340 public function countAllEntriesByUserIdAndTagId($userId, $tagId)
341 {
342 $qb = $this->createQueryBuilder('e')
343 ->select('count(e.id)')
344 ->leftJoin('e.tags', 't')
345 ->where('e.user=:userId')->setParameter('userId', $userId)
346 ->andWhere('t.id=:tagId')->setParameter('tagId', $tagId)
347 ;
348
349 return (int) $qb->getQuery()->getSingleScalarResult();
350 }
351
352 /**
353 * Remove all entries for a user id. 333 * Remove all entries for a user id.
354 * Used when a user want to reset all informations. 334 * Used when a user want to reset all informations.
355 * 335 *