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