From 66ecf2585ad1b4e5145b6c7bb723dfa4402d08fe Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 7 Apr 2023 00:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Model.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Base/Model.php b/Base/Model.php index a95b48f..1bd10b9 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -1015,14 +1015,22 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T */ public static function populate(array $data): static { - $model = new static(); + $model = replica(static::class); $model->_attributes = $data; $model->_oldAttributes = $data; $model->setIsNowExample(FALSE); return $model; } - - + + + /** + * @return void + */ + public function __clone(): void + { + } + + /** * @param $method * @param $value