改名
This commit is contained in:
@@ -45,22 +45,22 @@ class ActiveQuery extends Component
|
|||||||
public array $attributes = [];
|
public array $attributes = [];
|
||||||
|
|
||||||
|
|
||||||
/** @var ActiveRecord */
|
|
||||||
public ActiveRecord $modelClass;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comply constructor.
|
* Comply constructor.
|
||||||
* @param $model
|
* @param $model
|
||||||
* @param array $config
|
* @param array $config
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
public function __construct($model, $config = [])
|
public function __construct($model = null, $config = [])
|
||||||
{
|
{
|
||||||
|
if (empty($model)) {
|
||||||
|
return parent::__construct($config);
|
||||||
|
}
|
||||||
if (!is_object($model)) {
|
if (!is_object($model)) {
|
||||||
$model = Snowflake::createObject($model);
|
$model = Snowflake::createObject($model);
|
||||||
}
|
}
|
||||||
$this->modelClass = $model;
|
$this->modelClass = $model;
|
||||||
parent::__construct($config);
|
return parent::__construct($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ trait QueryTrait
|
|||||||
public bool $ifNotWhere = false;
|
public bool $ifNotWhere = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ActiveRecord
|
* @var ?ActiveRecord
|
||||||
*/
|
*/
|
||||||
public ActiveRecord $modelClass;
|
public ?ActiveRecord $modelClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear
|
* clear
|
||||||
|
|||||||
Reference in New Issue
Block a user