取消关联类无效的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

@@ -22,16 +22,14 @@ class HasOne extends OneToOne
* @param string $model 模型名
* @param string $foreignKey 关联外键
* @param string $localKey 关联主键
* @param array $alias 别名定义
* @param string $joinType JOIN类型
*/
public function __construct(Model $parent, $model, $foreignKey, $localKey, $alias = [], $joinType = 'INNER')
public function __construct(Model $parent, $model, $foreignKey, $localKey, $joinType = 'INNER')
{
$this->parent = $parent;
$this->model = $model;
$this->foreignKey = $foreignKey;
$this->localKey = $localKey;
$this->alias = $alias;
$this->joinType = $joinType;
$this->query = (new $model)->db();
}