87 $this->dataMapper = $this->objectManager->get(DataMapper::class, $this->query);
95 if (!is_array($this->queryResult)) {
96 $this->queryResult = $this->dataMapper->map($this->query->getType(), $this->persistenceManager->getObjectDataByQuery($this->query));
117 if (is_array($this->queryResult)) {
126 if ($firstResult ===
false) {
139 if ($this->numberOfResults ===
null) {
140 if (is_array($this->queryResult)) {
141 $this->numberOfResults =
count($this->queryResult);
143 $this->numberOfResults = $this->persistenceManager->getObjectCountByQuery($this->query);
157 return iterator_to_array($this);
171 return isset($this->queryResult[$offset]);
182 return $this->queryResult[$offset] ??
null;
195 $this->numberOfResults =
null;
196 $this->queryResult[$offset] = $value;
208 $this->numberOfResults =
null;
209 unset($this->queryResult[$offset]);
219 return current($this->queryResult);
226 public function key()
229 return key($this->queryResult);
235 public function next()
247 reset($this->queryResult);
257 return current($this->queryResult) !==
false;