This commit is contained in:
2021-04-25 15:59:13 +08:00
parent 504f63fd56
commit 60db4865fc
+3 -1
View File
@@ -142,7 +142,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
} }
/** /**
* @param $name * @param $name
* @param $method * @param $method
@@ -1006,11 +1005,14 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/ */
public static function populate(array $data): static public static function populate(array $data): static
{ {
$create = microtime(true);
/** @var static $model */ /** @var static $model */
$model = Snowflake::createObject(static::class); $model = Snowflake::createObject(static::class);
$model->_attributes = $data; $model->_attributes = $data;
$model->_oldAttributes = $data; $model->_oldAttributes = $data;
$model->setIsCreate(false); $model->setIsCreate(false);
echo 'end create -> ' . (microtime(true) - $create);
return $model; return $model;
} }