示例#1
0
 private function _get_comments()
 {
     $comments = array();
     $sql = sprintf("SELECT feedback_id FROM legislation_feedback WHERE legislation_id=%d AND comments IS NOT NULL ORDER BY feedback_date DESC", $this->id());
     $data = db()->Get_Table($sql);
     if (!empty($data)) {
         foreach ($data as $row) {
             $c = new Legislation_Feedback($row['feedback_id']);
             $comments[] = array('feedback_id' => $c->id(), 'legislation_id' => $c->legislation_id(), 'user_id' => $c->user->id(), 'user_handle' => $c->user->get_handle(), 'comments' => $c->comments(), 'response' => $c->response(), 'date' => $c->feedback_date());
         }
     }
     return $comments;
 }