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; }
public function loadAll() { $this->topicArray = Topic::loadAll(); }