| Server IP : 195.134.90.114 / Your IP : 216.73.216.86 Web Server : Apache/2.4.58 System : Linux nepub 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/public_html/lib/pkp/classes/notification/ |
Upload File : |
<?php
/**
* @file classes/notification/NotificationManagerDelegate.inc.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class NotificationManagerDelegate
* @ingroup notification
*
* @brief Abstract class to support notification manager delegates
* that provide default implementation to the interface that defines
* notification presentation data. It also introduce a method to be
* extended by subclasses to update notification objects.
*/
import('lib.pkp.classes.notification.PKPNotificationOperationManager');
abstract class NotificationManagerDelegate extends PKPNotificationOperationManager {
/** @var int NOTIFICATION_TYPE_... */
private $_notificationType;
/**
* Constructor.
* @param $notificationType int NOTIFICATION_TYPE_...
*/
function __construct($notificationType) {
$this->_notificationType = $notificationType;
}
/**
* Get the current notification type this manager is handling.
* @return int NOTIFICATION_TYPE_...
*/
function getNotificationType() {
return $this->_notificationType;
}
/**
* Define operations to update notifications.
* @param $request PKPRequest Request object
* @param $userIds array List of user IDs to notify
* @param $assocType int ASSOC_TYPE_...
* @param $assocId int ID corresponding to $assocType
* @return boolean True iff success
*/
function updateNotification($request, $userIds, $assocType, $assocId) {
return false;
}
/**
* Check if this manager delegate can handle the
* creation of the passed notification type.
* @copydoc PKPNotificationOperationManager::createNotification()
*/
function createNotification($request, $userId = null, $notificationType = null, $contextId = null, $assocType = null, $assocId = null, $level = NOTIFICATION_LEVEL_NORMAL, $params = null, $suppressEmail = false, callable $mailConfigurator = null) {
assert($notificationType == $this->getNotificationType() || $this->multipleTypesUpdate());
return parent::createNotification($request, $userId, $notificationType, $contextId, $assocType, $assocId, $level, $params, $suppressEmail, $mailConfigurator);
}
/**
* Flag a notification manager that handles multiple notification
* types inside the update method within the same call. Only set
* this to true if you're sure the notification manager provides
* all information for all notification types you're handling (via
* the getNotification... methods).
* @return boolean
*/
protected function multipleTypesUpdate() {
return false;
}
}