PKPNotificationOperationManager::createTrivialNotification PHP Method

createTrivialNotification() public method

Create a new notification with the specified arguments and insert into DB This is a static method
public createTrivialNotification ( $userId, $notificationType = NOTIFICATION_TYPE_SUCCESS, $params = null ) : Notification
$userId int
$notificationType int
$params array
return Notification object
    public function createTrivialNotification($userId, $notificationType = NOTIFICATION_TYPE_SUCCESS, $params = null)
    {
        $notificationDao = DAORegistry::getDAO('NotificationDAO');
        $notification = $notificationDao->newDataObject();
        $notification->setUserId($userId);
        $notification->setContextId(CONTEXT_ID_NONE);
        $notification->setType($notificationType);
        $notification->setLevel(NOTIFICATION_LEVEL_TRIVIAL);
        $notificationId = $notificationDao->insertObject($notification);
        if ($params) {
            $notificationSettingsDao = DAORegistry::getDAO('NotificationSettingsDAO');
            foreach ($params as $name => $value) {
                $notificationSettingsDao->updateNotificationSetting($notificationId, $name, $value);
            }
        }
        return $notification;
    }