This commit is contained in:
2021-06-04 18:30:47 +08:00
parent 3d9266dc16
commit 10805c1022
2 changed files with 8 additions and 7 deletions
+6 -5
View File
@@ -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);