From b4a69ef1632ccf1bae2cc1f103a5d56bac0a0829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 4 Mar 2021 15:27:03 +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/ActiveRecord.php | 5 +++-- Database/Base/BaseActiveRecord.php | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index d47bbbeb..6e59e2cd 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -296,15 +296,16 @@ class ActiveRecord extends BaseActiveRecord private function runRelate(): array { $relates = []; - if (empty($with = $this->getWith())) { + if (empty($this->_with)) { return $relates; } - foreach ($with as $val) { + foreach ($this->_with as $val) { $relates[$val] = $this->resolveObject($val); } return $relates; } + private array $_with = []; /** * @param $data diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index b8f93570..85631980 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -58,7 +58,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess protected ?SEvent $event; - protected array $_with = []; /** @var array */