public static function fromRow($row, $topic = null, $forum = null) { $post = new self($topic instanceof ForumTopic ? $topic : $row->topic_id, $forum instanceof Forum ? $forum : $row->forum_id, $row->user_id, $row->post_text, $row->post_time, $row->id); $post->setMarkdownEnabled($row->enable_markdown == '1'); $post->setSmileysEnabled($row->enable_smilies == '1'); $post->setURLsEnabled($row->enable_urls == '1'); if ($row->post_edit_time > 0) { $post->setEdit($row->post_edit_time, $row->post_edit_user_id); } return $post; }