From 10805c1022a9b24bc034bdbf9cee6aa819df76e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 4 Jun 2021 18:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/ActiveRecord.php | 4 ++-- Database/Base/BaseActiveRecord.php | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 43237297..6308b840 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -310,8 +310,8 @@ class ActiveRecord extends BaseActiveRecord } $data = array_merge($data, $this->runRelate()); - $class = Snowflake::app()->getChannel(); - $class->push($this, static::class); +// $class = Snowflake::app()->getChannel(); +// $class->push($this, static::class); return $data; } diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 35d9b698..59fd3b3a 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -1053,11 +1053,12 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess */ public static function populate(array $data): static { - $class = Snowflake::app()->getChannel(); - /** @var static $model */ - $model = $class->pop(static::class, function () { - return new static(); - }); +// $class = Snowflake::app()->getChannel(); +// /** @var static $model */ +// $model = $class->pop(static::class, function () { +// return new static(); +// }); + $model = new static(); $model->_attributes = $data; $model->_oldAttributes = $data; $model->setIsCreate(false);