改名
This commit is contained in:
@@ -49,9 +49,13 @@ class ActiveQuery extends Component
|
|||||||
* Comply constructor.
|
* Comply constructor.
|
||||||
* @param $model
|
* @param $model
|
||||||
* @param array $config
|
* @param array $config
|
||||||
|
* @throws
|
||||||
*/
|
*/
|
||||||
public function __construct($model, $config = [])
|
public function __construct($model, $config = [])
|
||||||
{
|
{
|
||||||
|
if (!is_object($model)) {
|
||||||
|
$model = Snowflake::createObject($model);
|
||||||
|
}
|
||||||
$this->modelClass = $model;
|
$this->modelClass = $model;
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
}
|
}
|
||||||
@@ -139,7 +143,7 @@ class ActiveQuery extends Component
|
|||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
$newModel = Snowflake::createObject($this->modelClass);
|
$newModel = $this->modelClass;
|
||||||
$newModel = $this->populate($newModel, $data);
|
$newModel = $this->populate($newModel, $data);
|
||||||
if ($this->asArray) {
|
if ($this->asArray) {
|
||||||
return $newModel->toArray();
|
return $newModel->toArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user