| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function getUserPendingInvitations(User $user) |
||
| 27 | { |
||
| 28 | $qb = $this->createQueryBuilder('i'); |
||
| 29 | $qb |
||
| 30 | ->select('i') |
||
| 31 | ->innerJoin('i.user', 'u') |
||
| 32 | ->innerJoin('i.survey', 's') |
||
| 33 | ->andWhere('i.user = :u') |
||
| 34 | ->andWhere('s.availFrom <= :now AND s.availTill >= :now') |
||
| 35 | ->andWhere('s.answered = 0') |
||
| 36 | ->setParameters([ |
||
| 37 | 'now' => new Datetime(), |
||
| 38 | 'u' => $user, |
||
| 39 | ]) |
||
| 40 | ->orderBy('s.availTill', Criteria::ASC) |
||
| 41 | ; |
||
| 42 | |||
| 43 | return $qb->getQuery()->getResult(); |
||
| 44 | } |
||
| 46 |