예제 #1
0
 /**
  * Permet d'obtenir une instance de la class <br>
  * Fait partie du design pattern <b>Singleton</b>
  * @return Une instance de TopicDAO
  * @since 1.0.0
  */
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new TopicDAO();
     }
     return self::$instance;
 }
예제 #2
0
 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);
     }
 }