From 52a5722837b3c6c22e42dccb6c3fe5d8643b322b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 16 Apr 2021 21:33:20 +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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 77ec8c57..c0006194 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -10,14 +10,13 @@ declare(strict_types=1); namespace Database; -use Exception; use Database\Base\BaseActiveRecord; +use Database\Traits\HasBase; +use Exception; use ReflectionException; use Snowflake\Channel; -use Snowflake\Exception\ComponentException; use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; -use Database\Traits\HasBase; defined('SAVE_FAIL') or define('SAVE_FAIL', 3227); defined('FIND_OR_CREATE_MESSAGE') or define('FIND_OR_CREATE_MESSAGE', 'Create a new model, but the data cannot be empty.'); @@ -220,7 +219,7 @@ class ActiveRecord extends BaseActiveRecord public static function inserts(array $data): bool { /** @var static $class */ - $class = Snowflake::createObject(static::className()); + $class = Snowflake::createObject(['class' => static::class]); if (empty($data)) { return $class->addError('Insert data empty.', 'mysql'); } @@ -321,7 +320,7 @@ class ActiveRecord extends BaseActiveRecord */ public function recover() { - $this->clean(); + $this->clean(); /** @var Channel $channel */ $channel = Snowflake::app()->get('channel');