|
@@ -140,10 +140,12 @@ class Entity {
|
|
* @method \$this setLimitHooker(callable \$func)
|
|
* @method \$this setLimitHooker(callable \$func)
|
|
* @method \$this setCacheHooker(callable \$func)
|
|
* @method \$this setCacheHooker(callable \$func)
|
|
* @method \$this setQueryFieldsHooker(callable \$func)
|
|
* @method \$this setQueryFieldsHooker(callable \$func)
|
|
|
|
+ * @method \$this clear()
|
|
|
|
+ * @method array properties()
|
|
* @method bool exit()
|
|
* @method bool exit()
|
|
* @method \$this get()
|
|
* @method \$this get()
|
|
* @method Response info()
|
|
* @method Response info()
|
|
- * @method Response save()
|
|
|
|
|
|
+ * @method Response add()
|
|
* @method Response remove()
|
|
* @method Response remove()
|
|
* @method Response update()
|
|
* @method Response update()
|
|
* @method Response updateFields()
|
|
* @method Response updateFields()
|
|
@@ -324,8 +326,10 @@ DOC;
|
|
*/
|
|
*/
|
|
public function primaryKey(){
|
|
public function primaryKey(){
|
|
DOC;
|
|
DOC;
|
|
|
|
+ $exclude = "\t\treturn array();";
|
|
if($primaryKey) {
|
|
if($primaryKey) {
|
|
$next[] = "\t\treturn array('". join("','", $this->convertToProperties($primaryKey)). "');";
|
|
$next[] = "\t\treturn array('". join("','", $this->convertToProperties($primaryKey)). "');";
|
|
|
|
+ $exclude = "\t\treturn array('". join("','", $this->convertToProperties($primaryKey)). "');";
|
|
}else{
|
|
}else{
|
|
$next[] = <<<DOC
|
|
$next[] = <<<DOC
|
|
throw new \Exception('请设置主键');
|
|
throw new \Exception('请设置主键');
|
|
@@ -336,12 +340,14 @@ DOC;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 保存数据的时候,验证唯一需要排除的值,此处仅支持,单个或联合排除,不支持单个排除
|
|
|
|
|
|
+ * 更新数据的时候,验证唯一需要排除的值,此处仅支持,单个或联合排除,不支持单个排除
|
|
*
|
|
*
|
|
* @return array
|
|
* @return array
|
|
*/
|
|
*/
|
|
public function exclude(){
|
|
public function exclude(){
|
|
- return array();
|
|
|
|
|
|
+DOC;
|
|
|
|
+ $next[] = $exclude;
|
|
|
|
+ $next[] = <<<DOC
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 添加时验证的字段,自行添加
|
|
* 添加时验证的字段,自行添加
|