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