示例#1
0
 public static function loadAll()
 {
     $dbWrapper = new DBWrapper();
     $connection = $dbWrapper->getConnection();
     $query = "SELECT * FROM topics";
     $topics = array();
     foreach ($connection->query($query) as $row) {
         $topic = new Topic($row['id'], $row['name'], $row['post_date'], $row['comment_count'], $connection);
         $topic->setComments();
         $topics[] = $topic;
     }
     return $topics;
 }
示例#2
0
 public function loadAll()
 {
     $this->topicArray = Topic::loadAll();
 }