model/Review中添加注释

This commit is contained in:
Li Jianxuan 2013-10-26 09:24:03 +00:00
parent a83c3ee18f
commit f31402c7be
1 changed files with 70 additions and 7 deletions

View File

@ -4,7 +4,7 @@ class Review extends Zend_Controller_Plugin_Abstract
private $db; //传入PDO对象. private $db; //传入PDO对象.
protected $events = NULL; //事件 protected $events = NULL; //事件
//使用到的公共变量 //相关数据表
public $tbl_reviewexp = "mdexpertreview"; public $tbl_reviewexp = "mdexpertreview";
public $tbl_mdreview = "mdreview"; public $tbl_mdreview = "mdreview";
public $tbl_user = "users"; public $tbl_user = "users";
@ -19,6 +19,15 @@ class Review extends Zend_Controller_Plugin_Abstract
} }
} }
/*
* events() 事件枚举
*
* @param $events Zend_EventManager_EventCollection default null
*
* return Zend_EventManager_EventManager
*
* 使用Zend_EventManager_EventManager枚举评审操作中的事件
*/
public function events(Zend_EventManager_EventCollection $events = NULL) public function events(Zend_EventManager_EventCollection $events = NULL)
{ {
if ($events !== NULL) { if ($events !== NULL) {
@ -29,7 +38,18 @@ class Review extends Zend_Controller_Plugin_Abstract
return $this->events; return $this->events;
} }
//接受或者拒绝评审 /*
* invite() 接受或者拒绝评审
*
* @param $id int
* @param $uuid uuid
* @param $uid int
* @param $status string
*
* return bool/string
*
* 处理评审邀请,接受或者拒绝
*/
function invite($id,$uuid,$uid,$status) function invite($id,$uuid,$uid,$status)
{ {
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid)) if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
@ -55,7 +75,15 @@ class Review extends Zend_Controller_Plugin_Abstract
} }
} }
//根据UUID获得评审意见 /*
* getReviews() 根据UUID获得评审意见
*
* @param $uuid uuid
*
* return array
*
* 传入评审数据的UUID返回评审意见记录
*/
function getReviews($uuid) function getReviews($uuid)
{ {
$sql = "SELECT mr.*,u.username,u.realname FROM ".$this->tbl_mdreview." mr $sql = "SELECT mr.*,u.username,u.realname FROM ".$this->tbl_mdreview." mr
@ -68,7 +96,15 @@ class Review extends Zend_Controller_Plugin_Abstract
return $reviews; return $reviews;
} }
//需要分配责任编辑的元数据评审 /*
* needEditor() 需要分配责任编辑的元数据评审
*
* @param $filter array
*
* return array
*
* filter参数帮助生成sql语句中的where、order、sort条件
*/
function needEditor($filter = "") function needEditor($filter = "")
{ {
$wheresql = array(); $wheresql = array();
@ -118,7 +154,16 @@ class Review extends Zend_Controller_Plugin_Abstract
return $rows; return $rows;
} }
//后台我负责的评审 /*
* adminReviews() 我负责的评审
*
* @param $filter array
*
* return array
*
* filter参数帮助生成sql语句中的where、order、sort条件
* 此函数返回当前登录的用户(管理员)负责的元数据评审
*/
function adminReviews($filter = "") function adminReviews($filter = "")
{ {
include_once('helper/view.php'); include_once('helper/view.php');
@ -178,7 +223,16 @@ class Review extends Zend_Controller_Plugin_Abstract
return $rows; return $rows;
} }
//发布 /*
* post() 通过评审
*
* @param $id int
* $param $emails array()
*
* return bool
*
* 元数据通过评审且发布
*/
function post($id,$emails) function post($id,$emails)
{ {
if(is_numeric($id)) if(is_numeric($id))
@ -204,7 +258,16 @@ class Review extends Zend_Controller_Plugin_Abstract
}//发布 }//发布
//检查管理员 /*
* post() 检查管理员
*
* @param $id int
* $param $emails array()
*
* return bool
*
* 元数据通过评审且发布
*/
function checkAdmin($id,$userid = 0) function checkAdmin($id,$userid = 0)
{ {
$id = (int)$id; $id = (int)$id;