Jake Vanderwerf
2026-08-26 18e7e415339ccc9adf8ade562f93abef606da16d
inc/rest/routes/NotificationsRoutes.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\rest\routes;
use JVBase\Instance;
use JVBase\managers\Cache;
use JVBase\managers\CustomTable;
use JVBase\registrar\Registrar;
@@ -23,6 +24,7 @@
 */
class NotificationsRoutes extends Rest
{
   use Instance;
   protected int $user_id;
   protected array $notification_types = [];
   protected object $manager;
@@ -107,10 +109,7 @@
      $this->cacheName = 'notifications';
      $this->cacheTtl = HOUR_IN_SECONDS;
      parent::__construct();
      // Connect notifications cache to user cache
      // When user data changes, notification cache should invalidate
      $this->cache->connect('user');
      $this->cache = Cache::for($this->cacheName, 'user', $this->cacheTtl);
      $this->notifications = CustomTable::for('notifications');
      $this->metrics = CustomTable::for('notification_metrics');
@@ -133,7 +132,7 @@
    */
   public function init(): void
   {
      $this->manager = JVB()->notification();
      $this->manager = NotificationManager::getInstance();
      $this->notification_types = $this->manager->getNotificationTypes(true);
   }
@@ -967,7 +966,7 @@
      }
      if (!empty($queueData)) {
         JVB()->queue()->queueOperation(
         Queue::getInstance()->queueOperation(
            'notification_' . $action,
            $args['user_id'],
            $queueData