PHP Class Piwik\Notification\Manager

Mostra file Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
cancel ( string $id ) Removes a posted notification by ID.
cancelAllNonPersistent ( ) Removes all temporary notifications.
getAllNotificationsToDisplay ( ) : ArrayObject Determine all notifications that needs to be displayed. They are sorted by priority. Highest priorities first.
notify ( string $id, Notification $notification ) Posts a notification that will be shown in Piwik's status bar. If a notification with the same ID has been posted and has not been closed/removed, it will be replaced with $notification.

Private Methods

Method Description
addNotification ( $id, Notification $notification )
checkId ( $id )
getAllNotifications ( )
getSession ( ) : Piwik\Session\SessionNamespace
isSessionEnabled ( )
removeNotification ( $id )
removeOldestNotificationsIfThereAreTooMany ( )
saveNotificationAcrossUiRequestsIfNeeded ( $id, Notification $notification )

Method Details

cancel() public static method

Removes a posted notification by ID.
public static cancel ( string $id )
$id string The notification ID, see {@link notify()}.

cancelAllNonPersistent() public static method

Call this method after the notifications have been displayed to make sure temporary notifications won't be displayed twice.
public static cancelAllNonPersistent ( )

getAllNotificationsToDisplay() public static method

Determine all notifications that needs to be displayed. They are sorted by priority. Highest priorities first.
public static getAllNotificationsToDisplay ( ) : ArrayObject
return ArrayObject

notify() public static method

Posts a notification that will be shown in Piwik's status bar. If a notification with the same ID has been posted and has not been closed/removed, it will be replaced with $notification.
public static notify ( string $id, Notification $notification )
$id string A unique identifier for this notification. The ID must be a valid HTML element ID. It can only contain alphanumeric characters (underscores can be used).
$notification Piwik\Notification The notification to post.