取消关联类无效的alias参数 仅morphTo关联保留 用于设置多态别名

This commit is contained in:
thinkphp
2017-01-16 23:03:12 +08:00
parent 908de8f4ee
commit 1568af03d8
9 changed files with 31 additions and 44 deletions

View File

@@ -20,6 +20,8 @@ class MorphTo extends Relation
// 多态字段
protected $morphKey;
protected $morphType;
// 多态别名
protected $alias;
/**
* 架构函数
@@ -74,6 +76,18 @@ class MorphTo extends Relation
return $model;
}
/**
* 设置多态别名
* @access public
* @param array $alias 别名定义
* @return $this
*/
public function setAlias($alias)
{
$this->alias = $alias;
return $this;
}
/**
* 预载入关联查询
* @access public