private static function getAllNotifications()
{
if (!self::isSessionEnabled()) {
return array();
}
$notifications = self::$notifications;
foreach ($notifications as $id => $notification) {
// we copy them over to the session if possible and persist it in case the session was not yet
// writable / enabled at the time the notification was added.
self::saveNotificationAcrossUiRequestsIfNeeded($id, $notification);
}
if (self::isSessionEnabled()) {
$session = static::getSession();
foreach ($session->notifications as $id => $notification) {
$notifications[$id] = $notification;
}
}
return $notifications;
}