From c5dbbb45daca52eb98c1c675e43a77e7f6f8da18 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 9 Dec 2016 14:52:37 +0800 Subject: [PATCH] =?UTF-8?q?Relation=E7=B1=BB=E6=96=B9=E6=B3=95=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model/Relation.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/library/think/model/Relation.php b/library/think/model/Relation.php index 39d62871..4fc68ff2 100644 --- a/library/think/model/Relation.php +++ b/library/think/model/Relation.php @@ -13,6 +13,7 @@ namespace think\model; use think\db\Query; use think\Exception; +use think\Model; abstract class Relation { @@ -40,15 +41,27 @@ abstract class Relation /** * 获取关联的所属模型 * @access public + * @return Model */ - public function getModel() + public function getParent() { return $this->parent; } + /** + * 获取当前的关联模型类 + * @access public + * @return string + */ + public function getModel() + { + return $this->model; + } + /** * 获取关联的查询对象 * @access public + * @return Query */ public function getQuery() {