diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-28 01:44:03 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-28 01:44:03 +0400 |
commit | c8773009e0b64241dd5c704394e675752c3b687e (patch) | |
tree | 82ad56294baca80174fb1b640b3a57252b13785d /core/Notification | |
parent | 442185c0b33483094ca56f4aa6566a0e19da4cd4 (diff) |
refs #4179 save notifications until delivered
Diffstat (limited to 'core/Notification')
-rw-r--r-- | core/Notification/Manager.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/Notification/Manager.php b/core/Notification/Manager.php index 2fd53a3c50..f35ba0ee93 100644 --- a/core/Notification/Manager.php +++ b/core/Notification/Manager.php @@ -34,17 +34,13 @@ class Manager { self::checkId($id); - $session = static::getSession(); + $session = static::getSession(); $session->$id = $notification; - - if (Notification::TYPE_PERSISTENT != $notification->type) { - $session->setExpirationHops(1, $id); - } } public static function getAllNotificationsToDisplay() { - $session = static::getSession(); + $session = static::getSession(); $notifications = $session->getIterator(); $notifications->uasort(function ($n1, $n2) { @@ -58,6 +54,17 @@ class Manager return $notifications; } + public static function cancelAllNonPersistent() + { + $session = static::getSession(); + + foreach ($session->getIterator() as $key => $notification) { + if (Notification::TYPE_PERSISTENT != $notification->type) { + unset($session->$key); + } + } + } + /** * Cancel a previously registered (or persistent) notification. * @param $id |