模型注释

This commit is contained in:
yunwuxin
2017-01-23 13:46:17 +08:00
parent 8311a4e39b
commit 6078d0ea39
11 changed files with 402 additions and 340 deletions

View File

@@ -15,13 +15,19 @@ use think\db\Query;
use think\Exception;
use think\Model;
/**
* Class Relation
* @package think\model
*
* @mixin Query
*/
abstract class Relation
{
// 父模型对象
protected $parent;
/** @var Model 当前关联的模型类 */
protected $model;
// 关联模型查询对象
/** @var Query 关联模型查询对象 */
protected $query;
// 关联表外键
protected $foreignKey;
@@ -65,7 +71,7 @@ abstract class Relation
/**
* 封装关联数据集
* @access public
* @param array $resultSet 数据集
* @param array $resultSet 数据集
* @return mixed
*/
protected function resultSetBuild($resultSet)
@@ -84,6 +90,13 @@ abstract class Relation
return $this;
}
/**
* 执行基础查询(进执行一次)
* @access protected
* @return void
*/
abstract protected function baseQuery();
public function __call($method, $args)
{
if ($this->query) {