This commit is contained in:
2021-04-27 16:22:00 +08:00
parent e2bf1acd48
commit 7a202df849
2 changed files with 7 additions and 8 deletions
+5 -6
View File
@@ -1036,12 +1036,11 @@ 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();
// });
$model = new static();
$class = Snowflake::app()->getChannel();
/** @var static $model */
$model = $class->pop(static::class, function () {
return new static();
});
$model->_attributes = $data;
$model->_oldAttributes = $data;
$model->setIsCreate(false);