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;
}