Jake Vanderwerf
2026-08-25 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a
inc/managers/VerifyEntryManager.php
@@ -5,19 +5,26 @@
   exit;
}
use JVBase\Instance;
use JVBase\registrar\Registrar;
use JVBase\managers\CustomTable;
use JVBase\rest\Rest;
use JVBase\rest\routes\ApprovalRoutes;
class VerifyEntryManager {
   use Instance;
   protected CustomTable $table;
   protected int $max = 3;
   public function __construct()
   protected Rest $route;
   private function __construct()
   {
      $this->route = ApprovalRoutes::getInstance();
      $this->defineTables();
   }
   protected function defineTables():void
   {
      $types = implode(',', array_map(function($item) { return "`{$item}`"; },Registrar::getFeatured('verify_entry')));
      $types = implode(',', array_map(function($item) { return "`{$item}`"; },Registrar::withFeature('verify_entry')));
      $table = CustomTable::for('verify_entry');
@@ -113,7 +120,7 @@
      ]);
      if ($request && !empty($owners)) {
         JVB()->notification()->notify($owners,'entry_requested',$userID, [
         NotificationManager::getInstance()->notify($owners,'entry_requested',$userID, [
            'target_id' => $termID,
            'target_type' => $taxonomy
         ]);
@@ -143,9 +150,9 @@
         wp_set_object_terms($request['content_id'], $termID, jvbCheckBase($request['taxonomy']));
      }
      JVB()->notification()?->notify($request['user_id'],$approve ? 'entry_approved' : 'entry_denied',$userID);
      NotificationManager::getInstance()?->notify($request['user_id'],$approve ? 'entry_approved' : 'entry_denied',$userID);
      //TODO: What if there are multiple managers, and one approved the request? Do we just delete the notification?
      JVB()->notification()?->unnotify($owners, 'entry_requested', $request['user_id'], [
      NotificationManager::getInstance()?->unnotify($owners, 'entry_requested', $request['user_id'], [
         'target_id' => $termID,
         'target_type' => $request['taxonomy']
      ]);