改名
This commit is contained in:
@@ -798,20 +798,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
|||||||
public static function populate(array $data)
|
public static function populate(array $data)
|
||||||
{
|
{
|
||||||
$model = new static();
|
$model = new static();
|
||||||
$model->setAttributes(self::parse($data));
|
$model->setAttributes($data);
|
||||||
$model->setIsCreate(false);
|
$model->setIsCreate(false);
|
||||||
$model->refresh();
|
$model->refresh();
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $data
|
|
||||||
* @return array
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private static function parse($data)
|
|
||||||
{
|
|
||||||
return static::getColumns()->populate($data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user