get(SessionStoreInterface::class); $service = $container->get(NotificationService::class); if (!$sessionStore instanceof SessionStoreInterface || !$service instanceof NotificationService) { return; } $currentTenant = $sessionStore->get('current_tenant', []); $tenantId = is_array($currentTenant) ? (int) ($currentTenant['id'] ?? 0) : 0; $sessionStore->set(self::SESSION_KEY, $service->unreadCount($userId, $tenantId > 0 ? $tenantId : null)); } public function clear(): void { unset($_SESSION[self::SESSION_KEY]); } }