| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function getFromLastOneReceived(User $user, int $lastMessageId = 0) |
||
| 23 | { |
||
| 24 | $qb = $this->createQueryBuilder('m'); |
||
| 25 | |||
| 26 | $qb |
||
| 27 | ->where( |
||
| 28 | $qb->expr()->eq('m.userReceiver', $user->getId()) |
||
| 29 | ) |
||
| 30 | ->andWhere( |
||
| 31 | $qb->expr()->eq('m.msgStatus', MESSAGE_STATUS_UNREAD) |
||
| 32 | ) |
||
| 33 | ->andWhere( |
||
| 34 | $qb->expr()->gt('m.id', $lastMessageId) |
||
| 35 | ) |
||
| 36 | ->orderBy( |
||
| 37 | 'm.sendDate', |
||
| 38 | Criteria::DESC |
||
| 39 | ) |
||
| 40 | ; |
||
| 41 | |||
| 42 | return $qb->getQuery()->getResult(); |
||
| 43 | } |
||
| 53 |