Entity/Repositories/NotificationRepository.php
public function getNotificationsToSend($recipientId)
    {
        $qb = $this->createQueryBuilder('n')
            ->andWhere('n.sent is null')
            ->andWhere('n.recipient_id = :recipientId')
            ->setParameter('recipientId', $recipientId)
            ->orderBy('n.importance', 'desc')
            ->orderBy('n.template', 'asc')
            ->orderBy('n.title', 'asc');
        $notifications = $qb->getQuery()->execute();

        return $notifications;
    }
public function getNotificationsToSend($recipientId)
    {
        $qb = $this->createQueryBuilder('n')
            ->andWhere('n.sent is null')
            ->andWhere('n.recipient_id = :recipientId')
            ->setParameter('recipientId', $recipientId)
            ->orderBy('n.importance', 'desc')
            ->orderBy('n.template', 'asc')
            ->orderBy('n.title', 'asc');
        $notifications = $qb->getQuery()->execute();

        return $notifications;
    }
public function getNotificationsToSend ( $ recipientId ) { $ qb = $ this -> createQueryBuilder ( 'n' ) -> andWhere ( 'n.sent is null' ) -> andWhere ( 'n.recipient_id = :recipientId' ) -> setParameter ( 'recipientId' , $ recipientId ) -> orderBy ( 'n.importance' , 'desc' ) -> orderBy ( 'n.template' , 'asc' ) -> orderBy ( 'n.title' , 'asc' ) ; $ notifications = $ qb -> getQuery ( ) -> execute ( ) ; return $ notifications ; }
Get all notifications that should be sent.

@param $recipientId

@return array of Notification
Get all notifications that should be sent .