<?php
//关键字验证类
class KeywordsCheck extends Check {
	
	public function addCheck(Model &$_model, $_param) {
		if (self::isNullString($_POST['name'])) {
			$this->_message[] = '名称不得为空！';
			$this->_flag = false;
		}
		if (self::isNullString($_POST['keywords'])) {
			$this->_message[] = '关键字不得为空！';
			$this->_flag = false;
		}						
		
		return $this->_flag;
	}
	
	public function updateCheck(Model &$_model) {
			if (self::isNullString($_POST['name'])) {
			$this->_message[] = '名称不得为空！';
			$this->_flag = false;
		}
		if (self::isNullString($_POST['keywords'])) {
			$this->_message[] = '关键字不得为空！';
			$this->_flag = false;
		}	
		return $this->_flag;
	}
	
	public function ajax(Model &$_model, Array $_param) {
		echo $_model->isOne($_param) ? 1 : 2;
	}
}
?>