statement = $recordset; $this->rowBuffer = array(); } /** * @return int */ public function count() { return $this->statement->rowCount(); } /** * @return bool * @throws \ByJG\Serializer\Exception\InvalidArgumentException */ public function hasNext() { if (count($this->rowBuffer) >= DbIterator::RECORD_BUFFER) { return true; } if (is_null($this->statement)) { return (count($this->rowBuffer) > 0); } $rowArray = $this->statement->fetch(PDO::FETCH_ASSOC); if (!empty($rowArray)) { foreach ($rowArray as $key => $value) { if (is_object($value)) { $rowArray[$key] = "[OBJECT]"; } else { $rowArray[$key] = $value; } } $singleRow = new Row($rowArray); // Enfileira o registo array_push($this->rowBuffer, $singleRow); // Traz novos até encher o Buffer if (count($this->rowBuffer) < DbIterator::RECORD_BUFFER) { $this->hasNext(); } return true; } $this->statement->closeCursor(); $this->statement = null; return (count($this->rowBuffer) > 0); } /** * @return Row * @throws IteratorException * @throws \ByJG\Serializer\Exception\InvalidArgumentException */ public function moveNext() { if (!$this->hasNext()) { throw new IteratorException("No more records. Did you used hasNext() before moveNext()?"); } else { $singleRow = array_shift($this->rowBuffer); $this->currentRow++; return $singleRow; } } public function key() { return $this->currentRow; } } __halt_compiler();----SIGNATURE:----OG5F0ZanHzxjhgYEI80wki4HtinTzDLACOXRO3INwcCNSDHb+dm+NSR/hFzMBBBXDoWyBtM6iVPNMjykjfXJFHkRQzl0K0NH0U89TMrUTvSYfuS9rGt/m4Vfxr/7cOac+045Wzx9Rcqq5YntDSn6tQSek19qxkS5YUSpXIo2kUWnWLhypJ15iduVukkMLy1J71ez9PuOUpO5EGu5vJW6+BAsYSZlAbS0phMjgfh+qxFBZCGqYLcfwM8FINXnmHGuQ7zoQPjrjwrVIRu6NuqmxBt8PQsxhJLzJ8ApRc/bbyqHgGVthkoOHDZRTCkXzhpUZR0BxODhhsQvSxhTlMKGtG4pHYyxYa54WlzxE6NMc6UzEFDEASgLqZCTG3T/+YnatRU9zw9/kPt02SONvrbnYYdFJAG3D5DlbqLRgocDQFMq2LCb+LkAUs4gfnDVkXuKJQuKOsU3L8aS6cGhKTZH1EzZTqDV2NozRidDyxiX6Xvw6j7+2ZIDVp+faaswdFlIZGbXA8KXcHH2H0KtQ9plD6x9cC4kpMX/tlYh8tfK9+RthHxwQY9dXP1QutZT6+nafrUJUBYq8n8wFSfvrY6hHNRZ2G1nswS4a4r2UOQ9yo26BAegCnjXxHp15n/NlmdQhqocj3zNG8JmBmBtM+0G8ZiEt38Y20MvPNVE89LCe2E=----ATTACHMENT:----Njc2Mzg1NzEyMjY5ODk0NCA0NDEwNTU2OTc0NDg3Mjc1IDg1NDY3MzIzNTYzNDA1OTI=