This commit is contained in:
2021-04-16 21:33:20 +08:00
parent 6e03278a00
commit 52a5722837
+4 -5
View File
@@ -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');