Skip to content

Commit

Permalink
Merge pull request #286 from thecodingmachine/fix-count-on-iterator-take
Browse files Browse the repository at this point in the history
fix issue in result iteratornow that total_count is not been initialized
  • Loading branch information
nguyenk authored May 15, 2024
2 parents bd4a1d8 + 206aabc commit 21cc4cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ResultIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 21cc4cc

Please sign in to comment.