Open Journal Systems  3.3.0
PKPNotificationManager Class Reference
Inheritance diagram for PKPNotificationManager:
PKPNotificationOperationManager INotificationInfoProvider NotificationManager

Public Member Functions

 getIconClass ($notification)
 
 getNotificationContents ($request, $notification)
 
 getNotificationMessage ($request, $notification)
 
 getNotificationTitle ($notification)
 
 getNotificationUrl ($request, $notification)
 
 getStyleClass ($notification)
 
 isVisibleToAllUsers ($notificationType, $assocType, $assocId)
 
 updateNotification ($request, $notificationTypes, $userIds, $assocType, $assocId)
 
- Public Member Functions inherited from PKPNotificationOperationManager
 createNotification ($request, $userId=null, $notificationType, $contextId=null, $assocType=null, $assocId=null, $level=NOTIFICATION_LEVEL_NORMAL, $params=null, $suppressEmail=false, callable $mailConfigurator=null)
 
 createTrivialNotification ($userId, $notificationType=NOTIFICATION_TYPE_SUCCESS, $params=null)
 
 deleteTrivialNotifications ($notifications)
 
 formatToGeneralNotification ($request, $notifications)
 
 formatToInPlaceNotification ($request, $notifications)
 
 getFormattedNotificationsForUser ($request, $userId, $level=NOTIFICATION_LEVEL_NORMAL, $contextId=null, $rangeInfo=null, $notificationTemplate='notification/notification.tpl')
 
 getParamsForCurrentLocale ($params)
 

Protected Member Functions

 getByDelegate ($notificationType, $assocType, $assocId, $operationName, $parameters)
 
 getMgrDelegate ($notificationType, $assocType, $assocId)
 
- Protected Member Functions inherited from PKPNotificationOperationManager
 fetchLinkActionNotificationContent ($linkAction, $request)
 
 getMailTemplate ($emailKey=null)
 
 getUserBlockedEmailedNotifications ($userId, $contextId)
 
 getUserBlockedNotifications ($userId, $contextId)
 
 sendNotificationEmail ($request, $notification, ?int $contextId, callable $mailConfigurator=null)
 

Detailed Description

Class for Notification Manager.

See also
NotificationDAO
Notification

Definition at line 20 of file PKPNotificationManager.inc.php.

Member Function Documentation

◆ getByDelegate()

PKPNotificationManager::getByDelegate (   $notificationType,
  $assocType,
  $assocId,
  $operationName,
  $parameters 
)
protected

Try to use a delegate to retrieve a notification data that's defined by the implementation of the

Parameters
$requestPKPRequest
$notificationNotification
$operationNamestring

Definition at line 416 of file PKPNotificationManager.inc.php.

References getMgrDelegate().

Referenced by getIconClass(), getNotificationContents(), getNotificationMessage(), getNotificationTitle(), getNotificationUrl(), getStyleClass(), and isVisibleToAllUsers().

◆ getIconClass()

PKPNotificationManager::getIconClass (   $notification)

Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from PKPNotificationOperationManager.

Reimplemented in NotificationManager.

Definition at line 271 of file PKPNotificationManager.inc.php.

References getByDelegate().

◆ getMgrDelegate()

PKPNotificationManager::getMgrDelegate (   $notificationType,
  $assocType,
  $assocId 
)
protected

Get the notification manager delegate based on the passed notification type.

Parameters
$notificationTypeint
$assocTypeint
$assocIdint
Returns
mixed Null or NotificationManagerDelegate

Reimplemented in NotificationManager.

Definition at line 360 of file PKPNotificationManager.inc.php.

Referenced by getByDelegate(), and updateNotification().

◆ getNotificationContents()

PKPNotificationManager::getNotificationContents (   $request,
  $notification 
)

Using the notification message, construct, if needed, any additional content for the notification body. If a specific notification type is not defined, it will return the parent method return value. Define a notification type case on this method only if you need to present more than just text in notification. If you need to define just a locale key, use the getNotificationMessage method only. Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from PKPNotificationOperationManager.

Definition at line 181 of file PKPNotificationManager.inc.php.

References getByDelegate(), and PKPTemplateManager\getManager().

◆ getNotificationMessage()

PKPNotificationManager::getNotificationMessage (   $request,
  $notification 
)

Return a message string for the notification based on its type and associated object. Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from PKPNotificationOperationManager.

Reimplemented in NotificationManager.

Definition at line 89 of file PKPNotificationManager.inc.php.

References getByDelegate(), DAORegistry\getDAO(), and AppLocale\requireComponents().

◆ getNotificationTitle()

PKPNotificationManager::getNotificationTitle (   $notification)

Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from PKPNotificationOperationManager.

Definition at line 215 of file PKPNotificationManager.inc.php.

References getByDelegate(), and DAORegistry\getDAO().

◆ getNotificationUrl()

PKPNotificationManager::getNotificationUrl (   $request,
  $notification 
)

Construct a URL for the notification based on its type and associated object Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from PKPNotificationOperationManager.

Reimplemented in NotificationManager.

Definition at line 26 of file PKPNotificationManager.inc.php.

References PKPApplication\get(), getByDelegate(), Application\getContextDAO(), DAORegistry\getDAO(), and Application\getPaymentManager().

◆ getStyleClass()

PKPNotificationManager::getStyleClass (   $notification)

Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from PKPNotificationOperationManager.

Reimplemented in NotificationManager.

Definition at line 244 of file PKPNotificationManager.inc.php.

References getByDelegate().

◆ isVisibleToAllUsers()

PKPNotificationManager::isVisibleToAllUsers (   $notificationType,
  $assocType,
  $assocId 
)

Whether any notification with the passed notification type is visible to all users or not.

Parameters
$notificationTypeint
$assocTypeint ASSOC_TYPE_...
$assocIdint
Returns
boolean

Reimplemented from PKPNotificationOperationManager.

Definition at line 296 of file PKPNotificationManager.inc.php.

References getByDelegate().

◆ updateNotification()

PKPNotificationManager::updateNotification (   $request,
  $notificationTypes,
  $userIds,
  $assocType,
  $assocId 
)
final

Update notifications by type using a delegate. If you want to be able to use this method to update notifications associated with a certain type, you need to first create a manager delegate and define it in getMgrDelegate() method.

Parameters
$requestPKPRequest
$notificationTypesarray The type(s) of the notification(s) to be updated.
$userIdsarray|null The notification user(s) id(s), or null for all.
$assocTypeint ASSOC_TYPE_... The notification associated object type.
$assocIdint The notification associated object id.
Returns
mixed Return false if no operation is executed or the last operation returned value.

Definition at line 335 of file PKPNotificationManager.inc.php.

References getMgrDelegate().


The documentation for this class was generated from the following file: