Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
70 | 4 | public function countAll(): int |
|
71 | { |
||
72 | 4 | $ids = $this->getClassMetadata()->getIdentifierFieldNames(); |
|
73 | 4 | $id = reset($ids); |
|
74 | 4 | $queryBuilder = $this->createQueryBuilder('entity'); |
|
75 | 4 | $queryBuilder->select($queryBuilder->expr()->count('entity.' . $id)); |
|
76 | |||
77 | 4 | return $queryBuilder->getQuery()->getSingleScalarResult(); |
|
78 | } |
||
79 | } |
||
80 |