From cf2f26ec2179fd2fc57fc67d5f8d6765e76c0f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 4 Jan 2022 17:27:37 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- src/Base/AbstractCollection.php | 2 +- src/Base/CollectionIterator.php | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/Base/AbstractCollection.php b/src/Base/AbstractCollection.php index f191d77..cfd99a4 100644 --- a/src/Base/AbstractCollection.php +++ b/src/Base/AbstractCollection.php @@ -101,7 +101,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat */ public function getIterator(): Traversable|CollectionIterator|ArrayIterator { - return new CollectionIterator($this->model, $this->query, $this->_item); + return new CollectionIterator($this->model, $this->_item); } diff --git a/src/Base/CollectionIterator.php b/src/Base/CollectionIterator.php index 36a1c26..9e43792 100644 --- a/src/Base/CollectionIterator.php +++ b/src/Base/CollectionIterator.php @@ -20,31 +20,17 @@ class CollectionIterator extends \ArrayIterator private ModelInterface|string $model; - /** @var ActiveQuery */ - private ActiveQuery $query; - - - private ?ModelInterface $_clone = null; - - - public function clean() - { - unset($this->query); - } - /** * CollectionIterator constructor. * @param $model - * @param $query * @param array $array * @param int $flags * @throws Exception */ - public function __construct($model, $query, array $array = [], int $flags = 0) + public function __construct($model, array $array = [], int $flags = 0) { $this->model = $model; - $this->query = $query; parent::__construct($array, $flags); }