Skip to content
Snippets Groups Projects
Commit 0d48dfce authored by Jeremy Guiselin's avatar Jeremy Guiselin
Browse files

notifications desc

parent 131075c0
Branches
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ use BackendBundle\Entity\Device;
use BackendBundle\Entity\Notification;
use BackendBundle\Entity\NotificationOnDevice;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;
class NotificationOnDeviceRepository extends EntityRepository
{
......@@ -21,10 +22,12 @@ class NotificationOnDeviceRepository extends EntityRepository
return $this->createQueryBuilder('s')
->where('s.notification IN (:notifications)')
->andWhere('s.device = :device')
->join('s.notification', 'n', Join::WITH, 's.notification = n')
->setParameters([
'device' => $device,
'notifications' => $notifications
])
->orderBy('n.date', 'DESC')
->getQuery()
->getResult();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment