From f0645f805ecdd19cf5ed9842f9e6b69a86dbcdeb Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 27 Aug 2026 15:28:09 +0000
Subject: [PATCH] =Notifications and routes minor cleanup. needs more work
---
inc/managers/NotificationManager.php | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/inc/managers/NotificationManager.php b/inc/managers/NotificationManager.php
index eeec9a6..b19dac9 100644
--- a/inc/managers/NotificationManager.php
+++ b/inc/managers/NotificationManager.php
@@ -1,10 +1,13 @@
<?php
namespace JVBase\managers;
+use JVBase\Instance;
use JVBase\managers\Notifications\Content;
use JVBase\managers\Notifications\EmailDigests;
use JVBase\managers\Notifications\Notifications;
use JVBase\managers\Notifications\Preferences;
+use JVBase\rest\Rest;
+use JVBase\rest\routes\NotificationsRoutes;
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
@@ -18,13 +21,16 @@
*/
class NotificationManager
{
+ use Instance;
protected Notifications $notifications;
protected Content $content;
protected EmailDigests $digest;
protected Preferences $preferences;
-
- public function __construct()
+ protected Rest $route;
+ private function __construct()
{
+ $this->route = NotificationsRoutes::getInstance();
+
$this->notifications = new Notifications();
$this->content = new Content();
$this->digest = new EmailDigests();
@@ -68,6 +74,10 @@
{
return $this->notifications->getUserNotifications($user_id, $args);
}
+ public function countUserNotifications(int $user_id, array $args = []):int
+ {
+ return $this->notifications->countUserNotifications($user_id, $args);
+ }
public function markRead(int $userID, int|array $notification_id):bool
{
@@ -82,6 +92,11 @@
return $this->notifications->markActioned($userID, $notification_id, $result);
}
+ public function getNotificationTypes(bool $all = false):array
+ {
+ return $this->notifications->getNotificationTypes($all);
+ }
+
/************************************************
* CONTENT NOTIFICATIONS
* These are pooled notifications of new content for:
--
Gitblit v1.10.0