aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-09-05 22:20:27 +0200
committerGitHub <noreply@github.com>2016-09-05 22:20:27 +0200
commit6f23289e721bd14710af1acc23466432c1312850 (patch)
tree58ce6aa0cc70d0a101f3233ca2258592e6d08515 /src/Wallabag/CoreBundle/Repository
parente5b090960bed3eb4a70c29c4acbae2027e17f7d6 (diff)
parent5173fd1c3d05d1fadfbdd4db862cd744209e13ac (diff)
downloadwallabag-6f23289e721bd14710af1acc23466432c1312850.tar.gz
wallabag-6f23289e721bd14710af1acc23466432c1312850.tar.zst
wallabag-6f23289e721bd14710af1acc23466432c1312850.zip
Merge pull request #2266 from wallabag/add-tags-counter
Added tags counter in sidebar (material theme)
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php23
-rw-r--r--src/Wallabag/CoreBundle/Repository/TagRepository.php4
2 files changed, 1 insertions, 26 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 24d1a57a..302e5a53 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -10,8 +10,6 @@ use Wallabag\CoreBundle\Entity\Tag;
10 10
11class EntryRepository extends EntityRepository 11class EntryRepository extends EntityRepository
12{ 12{
13 private $lifeTime;
14
15 /** 13 /**
16 * Return a query builder to used by other getBuilderFor* method. 14 * Return a query builder to used by other getBuilderFor* method.
17 * 15 *
@@ -311,25 +309,4 @@ class EntryRepository extends EntityRepository
311 309
312 return $qb->getQuery()->getSingleScalarResult(); 310 return $qb->getQuery()->getSingleScalarResult();
313 } 311 }
314
315 public function setLifeTime($lifeTime)
316 {
317 $this->lifeTime = $lifeTime;
318 }
319
320 /**
321 * Enable cache for a query.
322 *
323 * @param Query $query
324 *
325 * @return Query
326 */
327 public function enableCache(Query $query)
328 {
329 $query->useQueryCache(true);
330 $query->useResultCache(true);
331 $query->setResultCacheLifetime($this->lifeTime);
332
333 return $query;
334 }
335} 312}
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php
index abf915fe..41f61607 100644
--- a/src/Wallabag/CoreBundle/Repository/TagRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php
@@ -17,9 +17,7 @@ class TagRepository extends EntityRepository
17 { 17 {
18 return $this->createQueryBuilder('t') 18 return $this->createQueryBuilder('t')
19 ->leftJoin('t.entries', 'e') 19 ->leftJoin('t.entries', 'e')
20 ->where('e.user = :userId')->setParameter('userId', $userId) 20 ->where('e.user = :userId')->setParameter('userId', $userId);
21 ->getQuery()
22 ->getResult();
23 } 21 }
24 22
25 /** 23 /**