_notificationType = $notificationType; } /** * Get the current notification type this manager is handling. * * @return int NOTIFICATION_TYPE_... */ public function getNotificationType() { return $this->_notificationType; } /** * Define operations to update notifications. * * @param PKPRequest $request Request object * @param array $userIds List of user IDs to notify * @param int $assocType Application::ASSOC_TYPE_... * @param int $assocId ID corresponding to $assocType * * @return bool True iff success */ public 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() * * @param null|mixed $userId * @param null|mixed $notificationType * @param null|mixed $contextId * @param null|mixed $assocType * @param null|mixed $assocId * @param null|mixed $params */ public function createNotification($request, $userId = null, $notificationType = null, $contextId = null, $assocType = null, $assocId = null, $level = Notification::NOTIFICATION_LEVEL_NORMAL, $params = null) { assert($notificationType == $this->getNotificationType() || $this->multipleTypesUpdate()); return parent::createNotification($request, $userId, $notificationType, $contextId, $assocType, $assocId, $level, $params); } /** * 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 bool */ protected function multipleTypesUpdate() { return false; } } if (!PKP_STRICT_MODE) { class_alias('\PKP\notification\NotificationManagerDelegate', '\NotificationManagerDelegate'); }