注释改进

This commit is contained in:
thinkphp
2016-04-12 23:01:15 +08:00
parent 81a74f90ea
commit aa5d1c817b
2 changed files with 52 additions and 52 deletions

View File

@@ -145,7 +145,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 设置数据对象值
* @access public
* @param mixed $data 数据
* @return Model
* @return $this
*/
public function data($data = '')
{
@@ -435,7 +435,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 是否为更新数据
* @access public
* @param bool $update
* @return Model
* @return $this
*/
public function isUpdate($update = true)
{
@@ -484,7 +484,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @access public
* @param array|bool $rule 验证规则 true表示自动读取验证器类
* @param array $msg 提示信息
* @return Model
* @return $this
*/
public function validate($rule = true, $msg = [])
{
@@ -583,7 +583,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 写入数据
* @access public
* @param array $data 数据数组
* @return Model
* @return $this
*/
public static function create($data = [])
{
@@ -597,7 +597,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @access public
* @param array $data 数据数组
* @param array $where 更新条件
* @return integer
* @return $this
*/
public static function update($data = [], $where = [])
{
@@ -612,7 +612,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @param mixed $data 主键值或者查询条件(闭包)
* @param string $with 关联预查询
* @param bool $cache 是否缓存
* @return mixed
* @return \think\Model
*/
public static function get($data = '', $with = [], $cache = false)
{
@@ -646,7 +646,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @access public
* @param mixed $data 主键列表或者查询条件(闭包)
* @param string $with 关联预查询
* @return mixed
* @return array|false|string
*/
public static function all($data = [], $with = [])
{
@@ -684,7 +684,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 命名范围
* @access public
* @param string|Closure $name 命名范围名称 逗号分隔
* @return Model
* @return \think\Model
*/
public static function scope($name, $params = [])
{
@@ -725,7 +725,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 查询当前模型的关联数据
* @access public
* @param string|array $relations 关联名
* @return Model
* @return $this
*/
public function relationQuery($relations)
{
@@ -742,7 +742,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 使用关联预载入查询
* @access public
* @param string|array $relations 关联名
* @return Db
* @return \think\db\Driver
*/
public static function with($with = [])
{
@@ -852,7 +852,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @access public
* @param Model $result 数据对象
* @param string $relation 关联名
* @return Model
* @return \think\Model
*/
public function eagerlyResult($result, $relation)
{
@@ -961,7 +961,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @param string $model 模型名
* @param string $foreignKey 关联外键
* @param string $localKey 关联主键
* @return mixed
* @return \think\db\Driver|string
*/
public function hasOne($model, $foreignKey = '', $localKey = '')
{
@@ -986,7 +986,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @param string $model 模型名
* @param string $localKey 关联主键
* @param string $foreignKey 关联外键
* @return mixed
* @return \think\db\Driver|string
*/
public function belongsTo($model, $localKey = '', $foreignKey = '')
{
@@ -1010,7 +1010,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @param string $model 模型名
* @param string $foreignKey 关联外键
* @param string $localKey 关联主键
* @return mixed
* @return \think\db\Driver|string
*/
public function hasMany($model, $foreignKey = '', $localKey = '')
{
@@ -1034,7 +1034,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @param string $model 模型名
* @param string $localKey 关联主键
* @param string $foreignKey 关联外键
* @return mixed
* @return \think\db\Driver|string
*/
public function belongsToMany($model, $localKey = '', $foreignKey = '')
{
@@ -1055,7 +1055,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
/**
* 初始化数据库对象
* @access protected
* @return object
* @return \think\db\Driver
*/
protected static function db()
{

View File

@@ -491,7 +491,7 @@ abstract class Driver
* @param mixed $join 关联的表名
* @param mixed $condition 条件
* @param string $type JOIN类型
* @return Model
* @return $this
*/
public function join($join, $condition = null, $type = 'INNER')
{
@@ -545,7 +545,7 @@ abstract class Driver
* @access public
* @param mixed $union
* @param boolean $all
* @return Model
* @return $this
*/
public function union($union, $all = false)
{
@@ -630,7 +630,7 @@ abstract class Driver
* @param boolean $except 是否排除
* @param string $tableName 数据表名
* @param string $prefix 字段前缀
* @return Model
* @return $this
*/
public function field($field, $except = false, $tableName = '', $prefix = '')
{
@@ -670,7 +670,7 @@ abstract class Driver
* @param mixed $field 查询字段
* @param mixed $op 查询表达式
* @param mixed $condition 查询条件
* @return Db
* @return $this
*/
public function where($field, $op = null, $condition = null)
{
@@ -696,7 +696,7 @@ abstract class Driver
* @param mixed $field 查询字段
* @param mixed $op 查询表达式
* @param mixed $condition 查询条件
* @return Db
* @return $this
*/
public function whereOr($field, $op = null, $condition = null)
{
@@ -716,7 +716,7 @@ abstract class Driver
* @param mixed $field 查询字段
* @param mixed $op 查询表达式
* @param mixed $condition 查询条件
* @return Db
* @return $this
*/
protected function parseWhereExp($field, $op, $condition)
{
@@ -750,7 +750,7 @@ abstract class Driver
* 指定查询条件
* @access public
* @param mixed $where 条件表达式
* @return Db
* @return $this
*/
public function whereExist($where)
{
@@ -762,7 +762,7 @@ abstract class Driver
* 指定查询条件
* @access public
* @param mixed $where 条件表达式
* @return Model
* @return $this
*/
public function whereOrExist($where)
{
@@ -774,7 +774,7 @@ abstract class Driver
* 指定查询条件
* @access public
* @param mixed $where 条件表达式
* @return Model
* @return $this
*/
public function whereNotExist($where)
{
@@ -786,7 +786,7 @@ abstract class Driver
* 指定查询条件
* @access public
* @param mixed $where 条件表达式
* @return Model
* @return $this
*/
public function whereOrNotExist($where)
{
@@ -799,7 +799,7 @@ abstract class Driver
* @access public
* @param mixed $offset 起始位置
* @param mixed $length 查询数量
* @return Model
* @return $this
*/
public function limit($offset, $length = null)
{
@@ -815,7 +815,7 @@ abstract class Driver
* @access public
* @param mixed $page 页数
* @param mixed $listRows 每页数量
* @return Model
* @return $this
*/
public function page($page, $listRows = null)
{
@@ -830,7 +830,7 @@ abstract class Driver
* 指定数据表
* @access public
* @param string $table 表名
* @return Model
* @return $this
*/
public function table($table)
{
@@ -846,7 +846,7 @@ abstract class Driver
* USING支持 用于多表删除
* @access public
* @param mixed $using
* @return Model
* @return $this
*/
public function using($using)
{
@@ -863,7 +863,7 @@ abstract class Driver
* @access public
* @param string|array $field 排序字段
* @param string $order 排序
* @return Model
* @return $this
*/
public function order($field, $order = null)
{
@@ -880,7 +880,7 @@ abstract class Driver
* 指定group查询
* @access public
* @param string $group GROUP
* @return Model
* @return $this
*/
public function group($group)
{
@@ -892,7 +892,7 @@ abstract class Driver
* 指定having查询
* @access public
* @param string $having having
* @return Model
* @return $this
*/
public function having($having)
{
@@ -904,7 +904,7 @@ abstract class Driver
* 指定查询lock
* @access public
* @param boolean $lock 是否lock
* @return Model
* @return $this
*/
public function lock($lock = false)
{
@@ -916,7 +916,7 @@ abstract class Driver
* 指定distinct查询
* @access public
* @param string $distinct 是否唯一
* @return Model
* @return $this
*/
public function distinct($distinct)
{
@@ -928,7 +928,7 @@ abstract class Driver
* 指定数据表别名
* @access public
* @param string $alias 数据表别名
* @return Model
* @return $this
*/
public function alias($alias)
{
@@ -940,7 +940,7 @@ abstract class Driver
* 指定强制索引
* @access public
* @param string $force 索引名称
* @return Model
* @return $this
*/
public function force($force)
{
@@ -952,7 +952,7 @@ abstract class Driver
* 查询注释
* @access public
* @param string $comment 注释
* @return Model
* @return $this
*/
public function comment($comment)
{
@@ -964,7 +964,7 @@ abstract class Driver
* 获取执行的SQL语句
* @access public
* @param boolean $fetch 是否返回sql
* @return Model
* @return $this
*/
public function fetchSql($fetch = true)
{
@@ -976,7 +976,7 @@ abstract class Driver
* 不主动获取数据集
* @access public
* @param bool $pdo 是否返回 PDOStatement 对象
* @return Model
* @return $this
*/
public function fetchPdo($pdo = true)
{
@@ -987,7 +987,7 @@ abstract class Driver
/**
* 设置从主服务器读取数据
* @access public
* @return Model
* @return $this
*/
public function master()
{
@@ -999,7 +999,7 @@ abstract class Driver
* 指定当前模型
* @access public
* @param string $model 模型类名称
* @return object
* @return $this
*/
public function model($model)
{
@@ -1013,7 +1013,7 @@ abstract class Driver
* @param mixed $key 参数名
* @param mixed $value 绑定变量值
* @param integer $type 绑定类型
* @return Model
* @return $this
*/
public function bind($key, $value = false, $type = PDO::PARAM_STR)
{
@@ -1030,7 +1030,7 @@ abstract class Driver
* @access public
* @param Closure $scope 命名范围 闭包定义
* @param mixed $args 参数
* @return Db
* @return $this
*/
public function scope($scope = '', $args = null)
{
@@ -1143,7 +1143,7 @@ abstract class Driver
* @access public
* @param string|array $field 字段名
* @param string $value 字段值
* @return boolean
* @return integer
*/
public function setField($field, $value = '')
{
@@ -1161,7 +1161,7 @@ abstract class Driver
* @param string $field 字段名
* @param integer $step 增长值
* @param integer $lazyTime 延时时间(s)
* @return boolean
* @return integer|true
* @throws \think\Exception
*/
public function setInc($field, $step = 1, $lazyTime = 0)
@@ -1188,7 +1188,7 @@ abstract class Driver
* @param string $field 字段名
* @param integer $step 减少值
* @param integer $lazyTime 延时时间(s)
* @return boolean
* @return integer|true
* @throws \think\Exception
*/
public function setDec($field, $step = 1, $lazyTime = 0)
@@ -1261,7 +1261,7 @@ abstract class Driver
* 设置当前name
* @access public
* @param string $name
* @return Db
* @return $this
*/
public function name($name)
{
@@ -1270,10 +1270,10 @@ abstract class Driver
}
/**
* 得到完整的数据表名
* 查询参数赋值
* @access public
* @param array $options 表达式参数
* @return string
* @return $this
*/
public function options(array $options)
{
@@ -1972,7 +1972,7 @@ abstract class Driver
* 查找记录
* @access public
* @param array $options 表达式
* @return array|string
* @return \PDOStatement|array|string|false
*/
public function select($data = [])
{
@@ -2089,7 +2089,7 @@ abstract class Driver
* 查找单条记录
* @access public
* @param array $options 表达式
* @return mixed
* @return \think\Model|\PDOStatement|array|string|false
*/
public function find($data = [])
{