This commit is contained in:
2020-10-28 16:51:40 +08:00
parent 07f1d8e650
commit dc96cff074
+1 -11
View File
@@ -798,20 +798,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
public static function populate(array $data)
{
$model = new static();
$model->setAttributes(self::parse($data));
$model->setAttributes($data);
$model->setIsCreate(false);
$model->refresh();
return $model;
}
/**
* @param $data
* @return array
* @throws Exception
*/
private static function parse($data)
{
return static::getColumns()->populate($data);
}
}