src/Repository/HistoryRepository.php 1 location
|
@@ 28-38 (lines=11) @@
|
25 |
|
return $query->execute(); |
26 |
|
} |
27 |
|
|
28 |
|
public function getCount() |
29 |
|
{ |
30 |
|
$qb = $this->createQueryBuilder('u'); |
31 |
|
$qb->select($qb->expr()->count('u')); |
32 |
|
|
33 |
|
$query = $qb->getQuery(); |
34 |
|
|
35 |
|
$query->useResultCache(true, 3600); |
36 |
|
|
37 |
|
return $query->getSingleScalarResult(); |
38 |
|
} |
39 |
|
} |
40 |
|
|
src/Repository/PostRepository.php 1 location
|
@@ 41-49 (lines=9) @@
|
38 |
|
* @param string $tagSlug |
39 |
|
* @return int |
40 |
|
*/ |
41 |
|
public function getCount($tagSlug = null) |
42 |
|
{ |
43 |
|
$qb = $this->getTaggedPostsQuery($tagSlug); |
44 |
|
$qb->select($qb->expr()->count('u')); |
45 |
|
|
46 |
|
$query = $qb->getQuery()->enableResultCache(self::CACHE_TTL); |
47 |
|
|
48 |
|
return $query->getSingleScalarResult(); |
49 |
|
} |
50 |
|
|
51 |
|
/** |
52 |
|
* @param string $tagSlug |