Esempio n. 1
0
 public static function getCommentsByArticle($article_id)
 {
     $comments = array();
     if (!empty($article_id)) {
         $comment_rows = DB::select()->from('Comments')->where('article_id', '=', $article_id)->where('is_removed', '=', 0)->order_by('id', 'ASC')->order_by('parent_id', 'ASC')->execute();
         foreach ($comment_rows as $comment_row) {
             $comment = new Model_Comment();
             $comment->fillByRow($comment_row);
             array_push($comments, $comment);
         }
     }
     return $comments;
 }