コード例 #1
0
 public static function delete_comment($comment_id)
 {
     $comment = CommentsCache::load()->get_comment($comment_id);
     CommentsDAO::delete_comment($comment_id);
     CommentsTopicDAO::decremente_number_comments_topic($comment['id_topic']);
     self::regenerate_cache();
 }
コード例 #2
0
 public static function __static()
 {
     self::$user = AppContext::get_current_user();
     self::$lang = LangLoader::get('main');
     self::$common_lang = LangLoader::get('common');
     self::$comments_lang = LangLoader::get('comments-common');
     self::$comments_cache = CommentsCache::load();
     self::$template = new FileTemplate('framework/content/comments/comments.tpl');
     self::$template->add_lang(self::$comments_lang);
 }
コード例 #3
0
 private function register_note($note_type, $comment_id)
 {
     $comment = CommentsCache::load()->get_comment($comment_id);
     $current_note = $comment['note'];
     switch ($note_type) {
         case self::LESS_NOTE:
             $note = $current_note - 1;
             break;
         case self::PLUS_NOTE:
             $note = $current_note + 1;
             break;
     }
     $columns = array('note' => $note);
     $condition = "WHERE id = :id";
     $parameters = array('id' => $comment_id);
     PersistenceContext::get_querier()->update(DB_TABLE_COMMENTS, $columns, $condition, $parameters);
     $this->regenerate_cache();
 }
コード例 #4
0
 private function get_contents()
 {
     $comment = CommentsCache::load()->get_comment($this->id_comment);
     return $comment['message'];
 }
コード例 #5
0
 public static function __static()
 {
     self::$comments_cache = CommentsCache::load();
     self::$db_querier = PersistenceContext::get_querier();
 }