PHP Class PKPNotificationOperationManager, pkp-lib

Inheritance: implements INotificationInfoProvider
Afficher le fichier Open project: pkp/pkp-lib Class Usage Examples

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

__construct() public méthode

Constructor.
public __construct ( )

createNotification() public méthode

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.
Résultat Notification object

createTrivialNotification() public méthode

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
Résultat Notification object

deleteTrivialNotifications() public méthode

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

fetchLinkActionNotificationContent() protected méthode

Get a notification content with a link action.
protected fetchLinkActionNotificationContent ( $linkAction, $request ) : string
$linkAction LinkAction
$request Request
Résultat string

formatToGeneralNotification() public méthode

General notification data formating.
public formatToGeneralNotification ( $request, array $notifications ) : array
$request PKPRequest
$notifications array
Résultat array

formatToInPlaceNotification() public méthode

In place notification data formating.
public formatToInPlaceNotification ( $request, $notifications ) : array
$request PKPRequest
$notifications array
Résultat array

getFormattedNotificationsForUser() public méthode

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
Résultat object DAOResultFactory containing matching Notification objects

getIconClass() public méthode

public getIconClass ( $notification )

getMailTemplate() protected méthode

Get a template mail instance.
See also: MailTemplate
protected getMailTemplate ( $emailKey = null ) : MailTemplate
$emailKey string
Résultat MailTemplate

getNotificationContents() public méthode

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

getNotificationMessage() public méthode

public getNotificationMessage ( $request, $notification )

getNotificationTitle() public méthode

public getNotificationTitle ( $notification )

getNotificationUrl() public méthode

public getNotificationUrl ( $request, $notification )

getParamsForCurrentLocale() public méthode

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
Résultat array

getStyleClass() public méthode

public getStyleClass ( $notification )

getUserBlockedEmailedNotifications() protected méthode

Get set of notification types user will also be notified by email.
protected getUserBlockedEmailedNotifications ( $userId, $contextId ) : array
Résultat array

getUserBlockedNotifications() protected méthode

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
Résultat array

isVisibleToAllUsers() public méthode

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

sendMailingListEmail() public méthode

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() public méthode

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