mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进Relation类增加getModel和getParentModel方法
This commit is contained in:
@@ -126,6 +126,26 @@ class Relation
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取父模型对象
|
||||||
|
* @access public
|
||||||
|
* @return Model
|
||||||
|
*/
|
||||||
|
public function getParentModel()
|
||||||
|
{
|
||||||
|
return $this->parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前的模型对象
|
||||||
|
* @access public
|
||||||
|
* @return Model
|
||||||
|
*/
|
||||||
|
public function getModel()
|
||||||
|
{
|
||||||
|
return (new $this->model);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预载入关联查询 返回数据集
|
* 预载入关联查询 返回数据集
|
||||||
* @access public
|
* @access public
|
||||||
|
|||||||
Reference in New Issue
Block a user