Пример #1
0
 public function initSubscriptionsForUser($userId)
 {
     // User Directed Events
     $this->subscribe($userId, 'USER.' . $userId);
     $pdo = new ForumServicePDO();
     $forums = $pdo->getForumsForUser($userId);
     foreach ($forums as $forum) {
         $this->subscribe($userId, 'FORUM.' . $forum['id']);
     }
 }
Пример #2
0
 /**
  *
  * @see ForumServicePDO::getForumsForUser()
  */
 public static function getForumsForUser()
 {
     try {
         $pdo = new ForumServicePDO();
         $userId = AppUtils::getUserId();
         $forums = $pdo->getForumsForUser($userId);
         AppUtils::sendResponse($forums);
     } catch (PDOException $e) {
         AppUtils::logError($e, __METHOD__);
         AppUtils::sendError($e->getCode(), "Error getting forums for user {$userId}", $e->getMessage());
     }
 }