Entity/Repositories/NotificationRepository.php
public function markAllNotificationsAsSentFarInThePast($recipientId)
    {
        $qb = $this->getEntityManager()->createQueryBuilder()
            ->update("Azine\EmailBundle\Entity\Notification", 'n')
            ->set('n.sent', ':farInThePast')
            ->andWhere('n.sent is null')
            ->andWhere('n.recipient_id = :recipientId')
            ->setParameter('recipientId', $recipientId)
            ->setParameter('farInThePast', new \DateTime('1900-01-01'));
        $qb->getQuery()->execute();
    }
public function markAllNotificationsAsSentFarInThePast($recipientId)
    {
        $qb = $this->getEntityManager()->createQueryBuilder()
            ->update("Azine\EmailBundle\Entity\Notification", 'n')
            ->set('n.sent', ':farInThePast')
            ->andWhere('n.sent is null')
            ->andWhere('n.recipient_id = :recipientId')
            ->setParameter('recipientId', $recipientId)
            ->setParameter('farInThePast', new \DateTime('1900-01-01'));
        $qb->getQuery()->execute();
    }
public function markAllNotificationsAsSentFarInThePast ( $ recipientId ) { $ qb = $ this -> getEntityManager ( ) -> createQueryBuilder ( ) -> update ( "Azine\EmailBundle\Entity\Notification" , 'n' ) -> set ( 'n.sent' , ':farInThePast' ) -> andWhere ( 'n.sent is null' ) -> andWhere ( 'n.recipient_id = :recipientId' ) -> setParameter ( 'recipientId' , $ recipientId ) -> setParameter ( 'farInThePast' , new \ DateTime ( '1900-01-01' ) ) ; $ qb -> getQuery ( ) -> execute ( ) ; }
Mark all notifications as sent "far in the past". This is used for users that don't want to receive any notifications.

@param $recipientId
Mark all notifications as sent far in the past . This is used for users that don t want to receive any notifications .