<commit_before><?php
	/**
	 * commentController class
	 * controller class of the comment module
	 *
	 * @author NHN (<EMAIL>)
	 * @Adaptor DAOL Project (<EMAIL>)
	 * @package /modules/comment
	 * @version 0.1
	 */
	class commentController extends comment {
		/**
		 * Initialization
		 * @return void
		 */
		function init() {
		}

		/**
		 * Action to handle recommendation votes on comments (Up)
		 * @return Object
		 */
		function procCommentVoteUp() {
			if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');

			$comment_srl = Context::get('target_srl');
			if(!$comment_srl) return new Object(-1, 'msg_invalid_request');

			$oCommentModel = &getModel('comment');
			$oComment = $oCommentModel->getComment($comment_srl, false, false);
			$module_srl = $oComment->get('module_srl');
			if(!$module_srl) return new Object(-1, 'msg_invalid_request');

			$oModuleModel = &getModel('module');
			$comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl);
			if($comment_config->use_vote_up=='N') return new Object(-1, 'msg_invalid_request');

			$point = 1;
			return $this->updateVotedCount($comment_srl, $point);
		}

		/**
		 * Action to handle recommendation votes on comments (Down)
		 * @return Object
		 */
		function procCommentVoteDown() {
			if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');

			$comment_srl = Context::get('target_srl');
			if(!$comment_srl) return new Object(-1, 'msg_invalid_request');

			$oCommentModel = &getModel('comment');
			$oComment = $oCommentModel->getComment($comment_srl, false, false);
			$module_srl = $oComment->get('module_srl');
			if(!$module_srl) return new Object(-1, 'msg_invalid_request');

			$oModuleModel = &getModel('module');
			$comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl);
			if($comment_config->use_vote_down=='N') return new Object(-1, 'msg_invalid_request');

			$point = -1;
			return $this->updateVotedCount($comment_srl, $point);
		}

		/**
		 * Action to be called when a comment posting is reported
		 * @return void|Object
		 */<commit_msg>댓글 추천/비추천 시에도 변경 된 추천 수를 반환하도록 개선<commit_after><?php
	/**
	 * commentController class
	 * controller class of the comment module
	 *
	 * @author NHN (<EMAIL>)
	 * @Adaptor DAOL Project (<EMAIL>)
	 * @package /modules/comment
	 * @version 0.1
	 */
	class commentController extends comment {
		/**
		 * Initialization
		 * @return void
		 */
		function init() {
		}

		/**
		 * Action to handle recommendation votes on comments (Up)
		 * @return Object
		 */
		function procCommentVoteUp() {
			if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');

			$comment_srl = Context::get('target_srl');
			if(!$comment_srl) return new Object(-1, 'msg_invalid_request');

			$oCommentModel = &getModel('comment');
			$oComment = $oCommentModel->getComment($comment_srl, false, false);
			$module_srl = $oComment->get('module_srl');
			if(!$module_srl) return new Object(-1, 'msg_invalid_request');

			$oModuleModel = &getModel('module');
			$comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl);
			if($comment_config->use_vote_up=='N') return new Object(-1, 'msg_invalid_request');

			$point = 1;
			$output = $this->updateVotedCount($comment_srl, $point);
			$this->add('voted_count', $output->get('voted_count'));
			return $output;
		}

		/**
		 * Action to handle recommendation votes on comments (Down)
		 * @return Object
		 */
		function procCommentVoteDown() {
			if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');

			$comment_srl = Context::get('target_srl');
			if(!$comment_srl) return new Object(-1, 'msg_invalid_request');

			$oCommentModel = &getModel('comment');
			$oComment = $oCommentModel->getComment($comment_srl, false, false);
			$module_srl = $oComment->get('module_srl');
			if(!$module_srl) return new Object(-1, 'msg_invalid_request');

			$oModuleModel = &getModel('module');
			$comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl);
			if($comment_config->use_vote_down=='N') return new Object(-1, 'msg_invalid_request');

			$point = -1;
			$output = $this->updateVotedCount($comment_srl, $point);
			$this->add('blamed_count', $output->get('blamed_count'));
			return $output;
		}

		/**
		 * Action to be called when a comment posting is reported
		 * @return void|Object
		 */
{'fraction_non_alphanumeric': 0.15948275862068967, 'fraction_numerical': 0.0054446460980036296, 'mean_word_length': 4.5810126582278485, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2350576', 'n_tokens_mistral': 1653, 'n_tokens_neox': 1451, 'n_words': 302}