model类增加removeRelation方法

This commit is contained in:
thinkphp
2017-06-19 15:27:55 +08:00
parent 381fb1fef8
commit d30316efda

View File

@@ -838,6 +838,17 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
return json_encode($this->toArray(), $options);
}
/**
* 移除当前模型的关联属性
* @access public
* @return $this
*/
public function removeRelation()
{
$this->relation = [];
return $this;
}
/**
* 转换当前模型数据集为数据集对象
* @access public