예제 #1
0
 public static function getByIdCat($idCat)
 {
     $rows = DaoCore::find('*', self::$table, ['idCat' => $idCat], '', ' = ');
     $categories = array();
     foreach ($rows as $row) {
         $categorie = new CategorieModel();
         $categorie->hydrate($row);
         array_push($categories, $categorie);
     }
     return $categories[0];
 }
예제 #2
0
 public static function getByIdTop($idTop)
 {
     $rows = DaoCore::find('*', self::$global_view, ['idTop' => $idTop], '', ' = ');
     $topics = array();
     foreach ($rows as $row) {
         $categorie = new CategorieModel();
         $categorie->hydrate($row);
         $topic = new TopicModel();
         $topic->hydrate($row);
         $topic->setCategorie($categorie);
         array_push($topics, $topic);
     }
     return $topics[0];
 }