| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function getFromLastOneReceived(User $user, $lastMessageId = 0) |
||
| 35 | { |
||
| 36 | $qb = $this->createQueryBuilder('m'); |
||
| 37 | |||
| 38 | $qb |
||
| 39 | ->where( |
||
| 40 | $qb->expr()->eq('m.userReceiver', $user->getId()) |
||
| 41 | ) |
||
| 42 | ->andWhere( |
||
| 43 | $qb->expr()->eq('m.msgStatus', MESSAGE_STATUS_UNREAD) |
||
| 44 | ) |
||
| 45 | ->andWhere( |
||
| 46 | $qb->expr()->gt('m.id', (int) $lastMessageId) |
||
| 47 | ) |
||
| 48 | ->orderBy( |
||
| 49 | 'm.sendDate', |
||
| 50 | 'DESC' |
||
| 51 | ); |
||
| 52 | |||
| 53 | return $qb->getQuery()->getResult(); |
||
| 54 | } |
||
| 56 |