Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | final class ReportRepository extends EntityRepository implements ReportRepositoryInterface |
||
14 | { |
||
15 | /** |
||
16 | * @throws NonUniqueResultException |
||
17 | */ |
||
18 | public function getLatestStockMovementIdOnAReport(ReportConfigurationInterface $reportConfiguration = null): int |
||
19 | { |
||
20 | $qb = $this->createQueryBuilder('r'); |
||
21 | $qb->select('MAX(s.id)') |
||
22 | ->join('r.stockMovements', 's') |
||
23 | ; |
||
24 | |||
25 | if (null !== $reportConfiguration) { |
||
26 | $qb->andWhere('r.reportConfiguration = :reportConfiguration') |
||
27 | ->setParameter('reportConfiguration', $reportConfiguration) |
||
28 | ; |
||
29 | } |
||
30 | |||
31 | return (int) $qb->getQuery()->getSingleScalarResult(); |
||
32 | } |
||
33 | |||
34 | public function findByUuid(string $uuid): ?ReportInterface |
||
42 | } |
||
43 | } |
||
44 |