This commit is contained in:
2023-04-07 00:11:28 +08:00
parent 84f7346d49
commit 66ecf2585a
+11 -3
View File
@@ -1015,14 +1015,22 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
*/ */
public static function populate(array $data): static public static function populate(array $data): static
{ {
$model = new static(); $model = replica(static::class);
$model->_attributes = $data; $model->_attributes = $data;
$model->_oldAttributes = $data; $model->_oldAttributes = $data;
$model->setIsNowExample(FALSE); $model->setIsNowExample(FALSE);
return $model; return $model;
} }
/**
* @return void
*/
public function __clone(): void
{
}
/** /**
* @param $method * @param $method
* @param $value * @param $value