更新内核,API接口开发的一些尝试,后期会增加API接口开发这块
This commit is contained in:
@@ -19,24 +19,26 @@ class Pivot extends Model
|
||||
/** @var Model */
|
||||
public $parent;
|
||||
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* 架构函数
|
||||
* @access public
|
||||
* @param Model $parent
|
||||
* @param array|object $data 数据
|
||||
* @param string $table 中间数据表名
|
||||
* @param Model $parent 上级模型
|
||||
* @param array|object $data 数据
|
||||
* @param string $table 中间数据表名
|
||||
*/
|
||||
public function __construct(Model $parent, $data = [], $table = '')
|
||||
{
|
||||
if (is_object($data)) {
|
||||
$this->data = get_object_vars($data);
|
||||
} else {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
$this->parent = $parent;
|
||||
|
||||
$this->table = $table;
|
||||
if (is_null($this->name)) {
|
||||
$this->name = $table;
|
||||
}
|
||||
|
||||
parent::__construct($data);
|
||||
|
||||
$this->class = $this->name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user