Skip to content

Commit c0ef34f

Browse files
authored
Update QueryObjectDataSource.php
1 parent 8001796 commit c0ef34f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/QueryObjectDataSource.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public function setLimitCallback($callback) {
9393

9494
protected function getResultSet(int $page = 1, ?int $itemsPerPage = null) {
9595
if (!$this->resultSet) {
96-
$this->resultSet = $this->queryObject->getResultSet($page, $itemsPerPage);
96+
$this->resultSet = $itemsPerPage
97+
? $this->queryObject->getResultSet($page, $itemsPerPage)->getIterator()
98+
: $this->queryObject->fetch();
9799
}
98100

99101
return $this->resultSet;
@@ -116,7 +118,7 @@ public function getData(): array {
116118
return $this->data;
117119
}
118120

119-
return iterator_to_array($this->getResultSet()->getIterator());
121+
return $this->getResultSet();
120122
}
121123

122124
/**

0 commit comments

Comments
 (0)