This commit is contained in:
2021-04-25 15:58:10 +08:00
parent ebf8faa903
commit 504f63fd56
+2 -1
View File
@@ -1006,10 +1006,11 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/
public static function populate(array $data): static
{
/** @var static $model */
$model = Snowflake::createObject(static::class);
$model->_attributes = $data;
$model->_oldAttributes = $data;
$model->setIsCreate(false);
$model->refresh();
return $model;
}