public static function cancelAllNonPersistent()
    {
        foreach (static::getAllNotifications() as $id => $notification) {
            if (Notification::TYPE_PERSISTENT != $notification->type) {
                static::removeNotification($id);
            }
        }
    }
public static function cancelAllNonPersistent()
    {
        foreach (static::getAllNotifications() as $id => $notification) {
            if (Notification::TYPE_PERSISTENT != $notification->type) {
                static::removeNotification($id);
            }
        }
    }
public static function cancelAllNonPersistent ( ) { foreach ( static :: getAllNotifications ( ) as $ id => $ notification ) { if ( Notification :: TYPE_PERSISTENT != $ notification -> type ) { static :: removeNotification ( $ id ) ; } } }
Removes all temporary notifications.

Call this method after the notifications have been
displayed to make sure temporary notifications won't be displayed twice.
Removes all temporary notifications .