PHP Класс PKPNotificationOperationManager, pkp-lib

Наследование: implements INotificationInfoProvider
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) Constructor.
createNotification ( $request, $userId = null, $notificationType, $contextId = null, $assocType = null, $assocId = null, $level = NOTIFICATION_LEVEL_NORMAL, $params = null, $suppressEmail = false ) : Notification Create a new notification with the specified arguments and insert into DB
createTrivialNotification ( $userId, $notificationType = NOTIFICATION_TYPE_SUCCESS, $params = null ) : Notification Create a new notification with the specified arguments and insert into DB This is a static method
deleteTrivialNotifications ( array $notifications ) Deletes trivial notifications from database.
formatToGeneralNotification ( $request, array $notifications ) : array General notification data formating.
formatToInPlaceNotification ( $request, $notifications ) : array In place notification data formating.
getFormattedNotificationsForUser ( $request, $userId, $level = NOTIFICATION_LEVEL_NORMAL, $contextId = null, $rangeInfo = null, $notificationTemplate = 'notification/notification.tpl' ) : object Construct a set of notifications and return them as a formatted string
getIconClass ( $notification )
getNotificationContents ( $request, $notification ) Provide the notification message as default content.
getNotificationMessage ( $request, $notification )
getNotificationTitle ( $notification )
getNotificationUrl ( $request, $notification )
getParamsForCurrentLocale ( $params ) : array Iterate through the localized params for a notification's locale key.
getStyleClass ( $notification )
isVisibleToAllUsers ( $notificationType, $assocType, $assocId )
sendMailingListEmail ( $request, $email, $token, $template ) Static function to send an email to a mailing list user e.g. regarding signup
sendToMailingList ( $request, $notification ) Send an update to all users on the mailing list

Защищенные методы

Метод Описание
fetchLinkActionNotificationContent ( $linkAction, $request ) : string Get a notification content with a link action.
getMailTemplate ( $emailKey = null ) : MailTemplate Get a template mail instance.
getUserBlockedEmailedNotifications ( $userId, $contextId ) : array Get set of notification types user will also be notified by email.
getUserBlockedNotifications ( $userId, $contextId ) : array Get set of notifications types user does not want to be notified of.

Приватные методы

Метод Описание
formatNotification ( $request, $notification, $notificationTemplate = 'notification/notification.tpl' ) : string Return a fully formatted notification for display
formatNotifications ( $request, $notifications, $notificationTemplate = 'notification/notification.tpl' ) * Return a string of formatted notifications for display
sendNotificationEmail ( $request, $notification ) Send an email to a user regarding the notification

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( )

createNotification() публичный Метод

Create a new notification with the specified arguments and insert into DB
public createNotification ( $request, $userId = null, $notificationType, $contextId = null, $assocType = null, $assocId = null, $level = NOTIFICATION_LEVEL_NORMAL, $params = null, $suppressEmail = false ) : Notification
$request PKPRequest
$userId int (optional)
$notificationType int
$contextId int
$assocType int
$assocId int
$level int
$params array
$suppressEmail boolean Whether or not to suppress the notification email.
Результат Notification object

createTrivialNotification() публичный Метод

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
Результат Notification object

deleteTrivialNotifications() публичный Метод

Deletes trivial notifications from database.
public deleteTrivialNotifications ( array $notifications )
$notifications array

fetchLinkActionNotificationContent() защищенный Метод

Get a notification content with a link action.
protected fetchLinkActionNotificationContent ( $linkAction, $request ) : string
$linkAction LinkAction
$request Request
Результат string

formatToGeneralNotification() публичный Метод

General notification data formating.
public formatToGeneralNotification ( $request, array $notifications ) : array
$request PKPRequest
$notifications array
Результат array

formatToInPlaceNotification() публичный Метод

In place notification data formating.
public formatToInPlaceNotification ( $request, $notifications ) : array
$request PKPRequest
$notifications array
Результат array

getFormattedNotificationsForUser() публичный Метод

Construct a set of notifications and return them as a formatted string
public getFormattedNotificationsForUser ( $request, $userId, $level = NOTIFICATION_LEVEL_NORMAL, $contextId = null, $rangeInfo = null, $notificationTemplate = 'notification/notification.tpl' ) : object
$request PKPRequest
$userId int
$level int optional
$contextId int optional
$rangeInfo object optional
$notificationTemplate string optional Template to use for constructing an individual notification for display
Результат object DAOResultFactory containing matching Notification objects

getIconClass() публичный Метод

public getIconClass ( $notification )

getMailTemplate() защищенный Метод

Get a template mail instance.
См. также: MailTemplate
protected getMailTemplate ( $emailKey = null ) : MailTemplate
$emailKey string
Результат MailTemplate

getNotificationContents() публичный Метод

Provide the notification message as default content.
public getNotificationContents ( $request, $notification )

getNotificationMessage() публичный Метод

public getNotificationMessage ( $request, $notification )

getNotificationTitle() публичный Метод

public getNotificationTitle ( $notification )

getNotificationUrl() публичный Метод

public getNotificationUrl ( $request, $notification )

getParamsForCurrentLocale() публичный Метод

For each parameter, return (in preferred order) a value for the user's current locale, a param for the journal's default locale, or the first value (in case the value is not localized)
public getParamsForCurrentLocale ( $params ) : array
$params array
Результат array

getStyleClass() публичный Метод

public getStyleClass ( $notification )

getUserBlockedEmailedNotifications() защищенный Метод

Get set of notification types user will also be notified by email.
protected getUserBlockedEmailedNotifications ( $userId, $contextId ) : array
Результат array

getUserBlockedNotifications() защищенный Метод

Get set of notifications types user does not want to be notified of.
protected getUserBlockedNotifications ( $userId, $contextId ) : array
$userId int The notification user
$contextId int
Результат array

isVisibleToAllUsers() публичный Метод

public isVisibleToAllUsers ( $notificationType, $assocType, $assocId )

sendMailingListEmail() публичный Метод

Static function to send an email to a mailing list user e.g. regarding signup
public sendMailingListEmail ( $request, $email, $token, $template )
$request PKPRequest
$email string
$token string the user's token (for confirming and unsubscribing)
$template string The mail template to use

sendToMailingList() публичный Метод

Send an update to all users on the mailing list
public sendToMailingList ( $request, $notification )
$request PKPRequest
$notification object Notification