8000 Merge pull request #286 from thecodingmachine/fix-count-on-iterator-take · thecodingmachine/tdbm@21cc4cc · GitHub
[go: up one dir, main page]

Skip to content

Commit 21cc4cc

Browse files
authored
Merge pull request #286 from thecodingmachine/fix-count-on-iterator-take
fix issue in result iteratornow that total_count is not been initialized
2 parents bd4a1d8 + 206aabc commit 21cc4cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ResultIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function getIterator()
184184
*/
185185
public function take($offset, $limit)
186186
{
187-
if ($this->totalCount === 0) {
187+
if ($this instanceof EmptyResultIterator) {
188188
return PageIterator::createEmpyIterator($this);
189189
}
190190
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);

0 commit comments

Comments
 (0)
0