| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function getLatestStockMovementIdOnAReport(ReportConfigurationInterface $reportConfiguration = null): ?int |
||
| 14 | { |
||
| 15 | $qb = $this->createQueryBuilder('r'); |
||
| 16 | $qb->select('MAX(s.id)') |
||
| 17 | ->join('r.stockMovements', 's') |
||
| 18 | ; |
||
| 19 | |||
| 20 | if (null !== $reportConfiguration) { |
||
| 21 | $qb->andWhere('r.reportConfiguration = :reportConfiguration') |
||
| 22 | ->setParameter('reportConfiguration', $reportConfiguration) |
||
| 23 | ; |
||
| 24 | } |
||
| 25 | |||
| 26 | $res = $qb->getQuery()->getSingleScalarResult(); |
||
| 27 | if (null === $res) { |
||
| 28 | return null; |
||
| 29 | } |
||
| 30 | |||
| 31 | return (int) $res; |
||
| 32 | } |
||
| 34 |