From 206aabc95d585140396769838b6cf495554b5592 Mon Sep 17 00:00:00 2001 From: Kevin NGUYEN Date: Wed, 15 May 2024 17:56:24 +0200 Subject: [PATCH] fix issue in result iteratornow that total_count is not been initialized --- src/ResultIterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResultIterator.php b/src/ResultIterator.php index 595c37a3..85fe1af5 100644 --- a/src/ResultIterator.php +++ b/src/ResultIterator.php @@ -184,7 +184,7 @@ public function getIterator() */ public function take($offset, $limit) { - if ($this->totalCount === 0) { + if ($this instanceof EmptyResultIterator) { return PageIterator::createEmpyIterator($this); } return PageIterator::createResultIterator($this, $this->queryFactory->getMagicSql(), $this->parameters, $limit, $offset, $this->queryFactory->getColumnDescriptors(), $this->objectStorage, $this->className, $this->tdbmService, $this->magicQuery, $this->mode, $this->logger);