public static function loadAll() { $dbWrapper = new PDOWrapper(); $connection = $dbWrapper->getConnection(); $query = "SELECT * FROM forum"; $forums = array(); foreach ($connection->query($query) as $row) { $forum = new Forum($row['id'], $row['theme'], $row['date'], $row['commentCount'], $connection); $forum->setComments(); $forums[] = $forum; } return $forums; }
public function loadAll() { $this->forumArray = Forum::loadAll(); }