| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 3 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 22 | public function selectNotExpiredByUser($user, $dashboard = false) |
||
| 23 | { |
||
| 24 | $qb = $this->createQueryBuilder('e') |
||
| 25 | ->join('e.user', 'user') |
||
| 26 | ->andWhere('user = :user') |
||
| 27 | ->setParameter('user', $user) |
||
| 28 | ->andWhere('e.expiredAt >= :date') |
||
| 29 | ->setParameter('date', new \DateTime()); |
||
| 30 | |||
| 31 | if ($dashboard) { |
||
| 32 | $qb->setMaxResults(2); |
||
| 33 | } |
||
| 34 | |||
| 35 | return $qb->getQuery()->getResult(); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |