From 10133953c3df9648222c9a5f287a9e55270c8d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 8 Sep 2020 10:26:34 +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/AbstractCollection.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Database/Base/AbstractCollection.php b/Database/Base/AbstractCollection.php index 0f29d4ae..116c86ef 100644 --- a/Database/Base/AbstractCollection.php +++ b/Database/Base/AbstractCollection.php @@ -110,8 +110,13 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat if (!$this->offsetExists($offset)) { return NULL; } + + if ($this->_item[$offset] instanceof ActiveRecord) { + return $this->_item[$offset]; + } + /** @var ActiveRecord $model */ - return $this->_item[$offset]; + return $this->model::populate($this->_item[$offset]); } /**