Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 8 | public function findByKeyAtTime(string $key, \DateTime $time): ?ObjectEntry |
|
33 | { |
||
34 | 8 | return $this->createQueryBuilder('e') |
|
35 | 8 | ->andWhere('e.key = :key') |
|
36 | 8 | ->andWhere('e.createdAt <= :time') |
|
37 | 8 | ->setParameters(['key' => $key, 'time' => $time]) |
|
38 | 8 | ->orderBy('e.createdAt', 'DESC') |
|
39 | 8 | ->setMaxResults(1) |
|
40 | 8 | ->getQuery() |
|
41 | 8 | ->getOneOrNullResult(); |
|
42 | } |
||
44 |