plugin/notification/Manager/NotificationManager.php
public function notifyUsers(Notification $notification, $userIds)
    {
        if (count($userIds) > 0) {
            foreach ($userIds as $userId) {
                if (null !== $userId && $notification->getUserId() !== $userId) {
                    $notificationViewer = new NotificationViewer();
                    $notificationViewer->setNotification($notification);
                    $notificationViewer->setViewerId($userId);
                    $notificationViewer->setStatus(false);
                    $this->getEntityManager()->persist($notificationViewer);
                }
            }
        }
        $this->getEntityManager()->flush();

        return $notification;
    }
public function notifyUsers(Notification $notification, $userIds)
    {
        if (count($userIds) > 0) {
            foreach ($userIds as $userId) {
                if (null !== $userId && $notification->getUserId() !== $userId) {
                    $notificationViewer = new NotificationViewer();
                    $notificationViewer->setNotification($notification);
                    $notificationViewer->setViewerId($userId);
                    $notificationViewer->setStatus(false);
                    $this->getEntityManager()->persist($notificationViewer);
                }
            }
        }
        $this->getEntityManager()->flush();

        return $notification;
    }
public function notifyUsers ( Notification $ notification , $ userIds ) { if ( count ( $ userIds ) > 0 ) { foreach ( $ userIds as $ userId ) { if ( null !== $ userId && $ notification -> getUserId ( ) !== $ userId ) { $ notificationViewer = new NotificationViewer ( ) ; $ notificationViewer -> setNotification ( $ notification ) ; $ notificationViewer -> setViewerId ( $ userId ) ; $ notificationViewer -> setStatus ( false ) ; $ this -> getEntityManager ( ) -> persist ( $ notificationViewer ) ; } } } $ this -> getEntityManager ( ) -> flush ( ) ; return $ notification ; }
Creates a notification viewer for every user in the list of people to be notified.

@param Notification $notification
@param $userIds

@internal param \Icap\NotificationBundle\Entity\NotifiableInterface $notifiable

@return \Icap\NotificationBundle\Entity\Notification
Creates a notification viewer for every user in the list of people to be notified .