Services/AzineNotifierService.php
protected function getNotificationsFor(RecipientInterface $recipient)
    {
        // get the notification mode
        $notificationMode = $recipient->getNotificationMode();

        // get the date/time of the last notification
        $lastNotificationDate = $this->getNotificationRepository()->getLastNotificationDate($recipient->getId());

        $sendNotifications = false;
        $timeDelta = time() - $lastNotificationDate->getTimestamp();

        if (RecipientInterface::NOTIFICATION_MODE_IMMEDIATELY == $notificationMode) {
            $sendNotifications = true;
        } elseif (RecipientInterface::NOTIFICATION_MODE_HOURLY == $notificationMode) {
            $sendNotifications = ($timeDelta > $this->getHourInterval());
        } elseif (RecipientInterface::NOTIFICATION_MODE_DAYLY == $notificationMode) {
            $sendNotifications = ($timeDelta > $this->getDayInterval());
        } elseif (RecipientInterface::NOTIFICATION_MODE_NEVER == $notificationMode) {
            $this->markAllNotificationsAsSentFarInThePast($recipient);

            return array();
        }

        // regularly sent notifications now
        if ($sendNotifications) {
            $notifications = $this->getNotificationRepository()->getNotificationsToSend($recipient->getId());

        // if notifications exist, that should be sent immediately, then send those now disregarding the users mailing-preferences.
        } else {
            $notifications = $this->getNotificationRepository()->getNotificationsToSendImmediately($recipient->getId());
        }

        return $notifications;
    }
protected function getNotificationsFor(RecipientInterface $recipient)
    {
        // get the notification mode
        $notificationMode = $recipient->getNotificationMode();

        // get the date/time of the last notification
        $lastNotificationDate = $this->getNotificationRepository()->getLastNotificationDate($recipient->getId());

        $sendNotifications = false;
        $timeDelta = time() - $lastNotificationDate->getTimestamp();

        if (RecipientInterface::NOTIFICATION_MODE_IMMEDIATELY == $notificationMode) {
            $sendNotifications = true;
        } elseif (RecipientInterface::NOTIFICATION_MODE_HOURLY == $notificationMode) {
            $sendNotifications = ($timeDelta > $this->getHourInterval());
        } elseif (RecipientInterface::NOTIFICATION_MODE_DAYLY == $notificationMode) {
            $sendNotifications = ($timeDelta > $this->getDayInterval());
        } elseif (RecipientInterface::NOTIFICATION_MODE_NEVER == $notificationMode) {
            $this->markAllNotificationsAsSentFarInThePast($recipient);

            return array();
        }

        // regularly sent notifications now
        if ($sendNotifications) {
            $notifications = $this->getNotificationRepository()->getNotificationsToSend($recipient->getId());

        // if notifications exist, that should be sent immediately, then send those now disregarding the users mailing-preferences.
        } else {
            $notifications = $this->getNotificationRepository()->getNotificationsToSendImmediately($recipient->getId());
        }

        return $notifications;
    }
protected function getNotificationsFor ( RecipientInterface $ recipient ) { // get the notification mode $ notificationMode = $ recipient -> getNotificationMode ( ) ; // get the date/time of the last notification $ lastNotificationDate = $ this -> getNotificationRepository ( ) -> getLastNotificationDate ( $ recipient -> getId ( ) ) ; $ sendNotifications = false ; $ timeDelta = time ( ) - $ lastNotificationDate -> getTimestamp ( ) ; if ( RecipientInterface :: NOTIFICATION_MODE_IMMEDIATELY == $ notificationMode ) { $ sendNotifications = true ; } elseif ( RecipientInterface :: NOTIFICATION_MODE_HOURLY == $ notificationMode ) { $ sendNotifications = ( $ timeDelta > $ this -> getHourInterval ( ) ) ; } elseif ( RecipientInterface :: NOTIFICATION_MODE_DAYLY == $ notificationMode ) { $ sendNotifications = ( $ timeDelta > $ this -> getDayInterval ( ) ) ; } elseif ( RecipientInterface :: NOTIFICATION_MODE_NEVER == $ notificationMode ) { $ this -> markAllNotificationsAsSentFarInThePast ( $ recipient ) ; return array ( ) ; } // regularly sent notifications now if ( $ sendNotifications ) { $ notifications = $ this -> getNotificationRepository ( ) -> getNotificationsToSend ( $ recipient -> getId ( ) ) ; // if notifications exist, that should be sent immediately, then send those now disregarding the users mailing-preferences. } else { $ notifications = $ this -> getNotificationRepository ( ) -> getNotificationsToSendImmediately ( $ recipient -> getId ( ) ) ; } return $ notifications ; }
Get the Notifications that have not yet been sent yet.
Ordered by "template" and "title".

@param RecipientInterface $recipient

@return array of Notification
Get the Notifications that have not yet been sent yet . Ordered by template and title .