public function getNotificationCount($notifiable_identifier, $notifiable_class, $seen = null)
    {
        $qb = $this->getNotificationCoundQb($notifiable_identifier, $notifiable_class);

        if ($seen !== null) {
            $whereSeen = $seen ? 1 : 0;
            $qb
                ->andWhere('nn.seen = :seen')
                ->setParameter('seen', $whereSeen);
        }
        return $qb->getQuery()->getSingleScalarResult();
    }
public function getNotificationCount($notifiable_identifier, $notifiable_class, $seen = null)
    {
        $qb = $this->getNotificationCoundQb($notifiable_identifier, $notifiable_class);

        if ($seen !== null) {
            $whereSeen = $seen ? 1 : 0;
            $qb
                ->andWhere('nn.seen = :seen')
                ->setParameter('seen', $whereSeen);
        }
        return $qb->getQuery()->getSingleScalarResult();
    }
public function getNotificationCount ( $ notifiable_identifier , $ notifiable_class , $ seen = null ) { $ qb = $ this -> getNotificationCoundQb ( $ notifiable_identifier , $ notifiable_class ) ; if ( $ seen !== null ) { $ whereSeen = $ seen ? 1 : 0 ; $ qb -> andWhere ( 'nn.seen = :seen' ) -> setParameter ( 'seen' , $ whereSeen ) ; } return $ qb -> getQuery ( ) -> getSingleScalarResult ( ) ; }
Get the count of Notifications for a Notifiable entity.

seen option results :
null : get all notifications
true : get seen notifications
false : get unseen notifications

@param string    $notifiable_identifier
@param string    $notifiable_class
@param bool|null $seen

@return int
@throws \Doctrine\ORM\NonUniqueResultException
@throws \Doctrine\ORM\NoResultException
Get the count of Notifications for a Notifiable entity .