src/AppBundle/Repository/HistoryRepository.php 1 location
|
@@ 20-30 (lines=11) @@
|
| 17 |
|
return $query->execute(); |
| 18 |
|
} |
| 19 |
|
|
| 20 |
|
public function getCount() |
| 21 |
|
{ |
| 22 |
|
$qb = $this->createQueryBuilder('u'); |
| 23 |
|
$qb->select($qb->expr()->count('u')); |
| 24 |
|
|
| 25 |
|
$query = $qb->getQuery(); |
| 26 |
|
|
| 27 |
|
$query->useResultCache(true, 3600); |
| 28 |
|
|
| 29 |
|
return $query->getSingleScalarResult(); |
| 30 |
|
} |
| 31 |
|
} |
| 32 |
|
|
src/AppBundle/Repository/AbstractRepository.php 1 location
|
@@ 11-17 (lines=7) @@
|
| 8 |
|
|
| 9 |
|
abstract class AbstractRepository extends EntityRepository implements BasicRepositoryInterface |
| 10 |
|
{ |
| 11 |
|
public function getCount() |
| 12 |
|
{ |
| 13 |
|
$qb = $this->createQueryBuilder('u'); |
| 14 |
|
$query = $qb->select($qb->expr()->count('u'))->getQuery(); |
| 15 |
|
|
| 16 |
|
return $query->getSingleScalarResult(); |
| 17 |
|
} |
| 18 |
|
|
| 19 |
|
/** |
| 20 |
|
* {@inheritdoc} |