| | |
| | | <?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 |
| | |
| | | */ |
| | | 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(); |
| | |
| | | { |
| | | 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 |
| | | { |