From 5fd07c23279d1ffdf4a07fb1769de2bdc113c873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Feb 2021 19:13:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Base/BaseActiveRecord.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 5e88044d..4497ec10 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -89,16 +89,25 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess /** * object init - * @throws ComponentException */ public function clean() { - $this->error(get_called_class() . ' clean after request.'); $this->_attributes = []; $this->_oldAttributes = []; } + /** + * + * @throws ComponentException + */ + public function __clone() + { + $this->error('__clone ' . get_called_class()); + $this->clean(); + } + + /** * @throws Exception */