public function bindAllTopic($forums) { if (!isset($forums)) { return null; } $topicDAO = TopicDAO::getInstance(); foreach ($forums as $forum) { $topics = $topicDAO->getAllByForum($forum->getId()); if (!$topics) { $topics = null; } $forum->setTopics($topics); } }