/** * Loads a list of objects for the specicifies parameters, returns an array of Object_Abstract elements * * @return array */ public function load() { $comments = array(); $commentsData = $this->db->fetchAll("SELECT id FROM plugin_ratingscomments_ratings" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit()); foreach ($commentsData as $commentData) { // return all comments as Type Commenting $comments[] = RatingsComments::getById($commentData["id"]); } $this->model->setComments($comments); return $comments; }
public function deleteComment($id) { $comment = RatingsComments::getById($id); $comment->delete(); }