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:----sTeY9p40HD84wKcGKTFSy2N9QXcXzrhFRk1FxKcy2Z8Oe1smJzPNXaADXyN5B0/CUbCMda9XxDF9cfWdZ9+B2R308m2wCznSmqkzJlUPP4EXaEiJbk5V+TK97WMw8RMtpGiKfradvzRTV7EMDBFsC65KMtuQM3l6p+nvox4MPG5hXYr/yjLLSPBqC8k95qZ8nTD+8Igft3AR15eCM5ClLQYrNkQY9mcDlunq48rHJAuxNcvHHSgG0NPC0sKGOJy0ckjEOjWpnHsHTfHqEUKiwD1y2m+bdJwLSs01tvOEHv1a5KpjVWPGVSAvUSyV14zO71iux0j4tDPlPRWraRxinuinRRTxSzKPqDAs5sRaAtRHj88mVbfU7+fPpZQokT4KX2yc9U6sEzGlBAEx6wZPvEcyuXq2PbuynvXpGrFskS57fSutOIvjAvUr4YUpgQTdl55l5mIeZ5OW/Oozi8EauQo8zAq4znJk+ITYd0ICDOScYA0vlRoH0VYBXbyU/9Kb0wOP+eeygKRx+rjX9JLku0vOXjpUBx74IHr7NeDH8K0hkOFTnmQehAByEPvQ0pMwJNw3z9sKYEA5PGOrV3qCqN2PtG2GxslPaAOCWPjQgv7R4RL5gS8SMWk6MDiEL18euPCtpgM9VmlPgzcTgr+H4x26fN1fg0Rsib/Ud0ogGpE=----ATTACHMENT:----MjcyNjk3MjcyMjMyOTM2OCA5NzYxMzM0NTQwNjYwOTUwIDk1Mzk3MzAxNjYyODM0MTk=