Esempio n. 1
0
 /**
  * Create object from and existing record
  *
  * @param int $foruminfo
  * @return vB_Legacy_Thread
  */
 public static function create_from_record($threadinfo)
 {
     $thread = new vB_Legacy_Thread();
     $current_user = new vB_Legacy_CurrentUser();
     if (array_key_exists('subscribethreadid', $threadinfo)) {
         $thread->subscribed[$current_user->getField('userid')] = (bool) $threadinfo['subscribethreadid'];
         unset($threadinfo['subscribethreadid']);
     }
     if (array_key_exists('readtime', $threadinfo)) {
         $thread->lastread[$current_user->getField('userid')] = $threadinfo['readtime'];
         unset($threadinfo['readtime']);
     }
     $thread->set_record($threadinfo);
     return $thread;
 }