Jake Vanderwerf
3 days ago ba1e1ccf869b818f7a7a897264dfea05563a7796
inc/managers/Notifications/EmailDigests.php
@@ -18,8 +18,6 @@
class EmailDigests
{
   protected string $campaign;
   protected Cache $terms;
   protected Cache $users;
   protected CustomTable $userIndex;
   protected CustomTable $termIndex;
   public function __construct()
@@ -45,7 +43,7 @@
      protected function registerUserIndex():void
      {
         $table = CustomTable::for('user_notification_email_digest');
//    $types = implode(',',array_map(function($item) { return "'{$item}'"; }, Registrar::getFeatured('favouritable')));
//    $types = implode(',',array_map(function($item) { return "'{$item}'"; }, Registrar::withFeature('favouritable')));
         $table->setColumns([
            'id'        => 'bigint(20) unsigned NOT NULL AUTO_INCREMENT',
            'user_id'      => "{$table->getUserIDType()} NOT NULL",
@@ -73,7 +71,7 @@
      protected function registerTermIndex():void
      {
         $table = CustomTable::for('user_notification_email_digest');
         $types = implode(',',array_map(function($item) { return "'{$item}'"; }, Registrar::getFeatured('favouritable', 'term')));
         $types = implode(',',array_map(function($item) { return "'{$item}'"; }, Registrar::withFeature('favouritable', 'term')));
         $table->setColumns([
            'id'        => 'bigint(20) unsigned NOT NULL AUTO_INCREMENT',
            'term_id'      => "{$table->getTermIDType()} NOT NULL",
@@ -189,8 +187,8 @@
      $content = '';
      foreach ($subscription as $item) {
         $temp = match ($item['item_type']) {
            array_merge(['user'], Registrar::getFeatured('favouritable', 'user')) => $this->getUserUpdates($item['item_id'], $frequency),
            Registrar::getFeatured('favouritable', 'term') => $this->getTermUpdates($item['item_id'], $item['item_type'], $frequency),
            array_merge(['user'], Registrar::withFeature('favouritable', 'user')) => $this->getUserUpdates($item['item_id'], $frequency),
            Registrar::withFeature('favouritable', 'term') => $this->getTermUpdates($item['item_id'], $item['item_type'], $frequency),
            default => false,
         };
         if ($temp) {