Esempio n. 1
0
 /**
  * Public factory method to create a post object
  *
  * @param array A post record to set to this object.
  * @param array|vB_Legacy_Thread If the thread for this post has already been loaded
  * @return vB_Legacy_Post
  */
 public static function create_from_record($record, $thread = null)
 {
     $post = new vB_Legacy_Post();
     $post->set_record($record);
     if (is_array($thread)) {
         $post->set_thread(vB_Legacy_Thread::create_from_record($thread));
     } else {
         if ($thread instanceof vB_Legacy_Thread) {
             $post->set_thread($thread);
         }
     }
     return $post;
 }