From d84ceaa353bceabd1ab6df68b2aa4715e60f4107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 8 Sep 2020 00:57:42 +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/CollectionIterator.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Database/Base/CollectionIterator.php b/Database/Base/CollectionIterator.php index af17326b..2e7e873d 100644 --- a/Database/Base/CollectionIterator.php +++ b/Database/Base/CollectionIterator.php @@ -5,6 +5,8 @@ namespace Database\Base; use Database\ActiveRecord; +use Snowflake\Exception\NotFindClassException; +use Snowflake\Snowflake; /** @@ -18,9 +20,20 @@ class CollectionIterator extends \ArrayIterator private $model; + /** + * CollectionIterator constructor. + * @param $model + * @param array $array + * @param int $flags + * @throws \ReflectionException + * @throws NotFindClassException + */ public function __construct($model, $array = array(), $flags = 0) { $this->model = $model; + if (is_string($model)) { + $this->model = Snowflake::createObject($model); + } parent::__construct($array, $flags); }