改名
This commit is contained in:
@@ -107,7 +107,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
||||
*/
|
||||
public function getModel(): ActiveRecord
|
||||
{
|
||||
return Snowflake::app()->getObject()->getConnection([$this->model], false);
|
||||
return Snowflake::app()->getObject()->get($this->model, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -899,7 +899,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
public static function populate(array $data): static
|
||||
{
|
||||
$object = Snowflake::app()->getObject();
|
||||
$model = $object->getConnection([static::class], false);
|
||||
$model = $object->get(static::class);
|
||||
$model->setAttributes($data);
|
||||
$model->setIsCreate(false);
|
||||
$model->refresh();
|
||||
|
||||
@@ -51,7 +51,7 @@ class CollectionIterator extends \ArrayIterator
|
||||
protected function newModel($current): ActiveRecord
|
||||
{
|
||||
$object = Snowflake::app()->getObject();
|
||||
$model = $object->getConnection([$this->model], false);
|
||||
$model = $object->get($this->model, false);
|
||||
|
||||
return $model->setAttributes($current);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user