注释改进

This commit is contained in:
thinkphp
2016-05-18 12:30:55 +08:00
parent 5dc8cd481e
commit a00c4c51fe
4 changed files with 47 additions and 34 deletions

View File

@@ -44,6 +44,7 @@ class Query
* 架构函数
* @access public
* @param \think\db\Connection|string $connection 数据库对象实例
* @param string $model 模型名
* @throws Exception
*/
public function __construct($connection = '', $model = '')
@@ -786,7 +787,19 @@ class Query
}
/**
* 指定默认数据表
* 指定默认数据表名(不含前缀)
* @access public
* @param string $name
* @return $this
*/
public function name($name)
{
$this->name = $name;
return $this;
}
/**
* 指定默认数据表名(含前缀)
* @access public
* @param string $table 表名
* @return $this
@@ -1046,23 +1059,11 @@ class Query
return $this;
}
/**
* 设置当前name
* @access public
* @param string $name
* @return $this
*/
public function name($name)
{
$this->name = $name;
return $this;
}
/**
* 获取数据表信息
* @access public
* @param string $fetch 获取信息类型 包括 fields type bind pk
* @param string $tableName 数据表名 留空自动获取
* @param string $fetch 获取信息类型 包括 fields type bind pk
* @return mixed
*/
public function getTableInfo($tableName = '', $fetch = '')
@@ -1113,7 +1114,7 @@ class Query
* 获取当前模型对象的主键
* @access public
* @param string $table 数据表名
* @return mixed
* @return string|array
*/
public function getPk($table = '')
{
@@ -1138,6 +1139,12 @@ class Query
return $this;
}
/**
* 检测参数是否已经绑定
* @access public
* @param string $key 参数名
* @return bool
*/
public function isBind($key)
{
return isset($this->bind[$key]);
@@ -1155,6 +1162,12 @@ class Query
return $this;
}
/**
* 获取当前的查询参数
* @access public
* @param string $name 参数名
* @return mixed
*/
public function getOptions($name = '')
{
return isset($this->options[$name]) ? $this->options[$name] : $this->options;
@@ -1164,7 +1177,7 @@ class Query
* 设置关联查询JOIN预查询
* @access public
* @param string|array $with 关联方法名称
* @return Db
* @return $this
*/
public function with($with)
{
@@ -1225,7 +1238,7 @@ class Query
* 设置当前字段添加的表别名
* @access public
* @param string $via
* @return Db
* @return $this
*/
public function via($via = '')
{
@@ -1237,7 +1250,7 @@ class Query
* 设置关联查询
* @access public
* @param string $relation 关联名称
* @return Db
* @return $this
*/
public function relation($relation)
{