src/Repository/HistoryRepository.php 1 location
|
@@ 15-26 (lines=12) @@
|
| 12 |
|
parent::__construct($registry, History::class); |
| 13 |
|
} |
| 14 |
|
|
| 15 |
|
public function findAllHistory($limit, $page) |
| 16 |
|
{ |
| 17 |
|
$qb = $this->createQueryBuilder('u') |
| 18 |
|
->setMaxResults($limit) |
| 19 |
|
->setFirstResult($page) |
| 20 |
|
->orderBy('u.dateTime', 'DESC') |
| 21 |
|
; |
| 22 |
|
|
| 23 |
|
$query = $qb->getQuery()->enableResultCache(60*60*24); |
| 24 |
|
|
| 25 |
|
return $query->execute(); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
public function getCount() |
| 29 |
|
{ |
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(60*60*24); |
| 47 |
|
|
| 48 |
|
return $query->getSingleScalarResult(); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
/** |
| 52 |
|
* @param string $tagSlug |