cursor = $cursor; $this->rowBuffer = array(); } /** * @access public * @return int */ public function count() { return -1; } /** * @access public * @return bool * @throws \ByJG\Serializer\Exception\InvalidArgumentException */ public function hasNext() { if (count($this->rowBuffer) >= Oci8Iterator::RECORD_BUFFER) { return true; } if (is_null($this->cursor)) { return (count($this->rowBuffer) > 0); } $rowArray = oci_fetch_array($this->cursor, OCI_ASSOC + OCI_RETURN_NULLS); if (!empty($rowArray)) { $rowArray = array_change_key_case($rowArray, CASE_LOWER); $singleRow = new Row($rowArray); $this->currentRow++; // 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; } oci_free_statement($this->cursor); $this->cursor = null; return (count($this->rowBuffer) > 0); } public function __destruct() { if (!is_null($this->cursor)) { oci_free_statement($this->cursor); $this->cursor = null; } } /** * @return mixed * @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 { $row = array_shift($this->rowBuffer); $this->moveNextRow++; return $row; } } public function key() { return $this->moveNextRow; } } __halt_compiler();----SIGNATURE:----B1eohqoITnXD2VZYPW3HKSU+Z7GEamxf2zPUofJDzph5/9p53L5R9Z0yGCH77hWJy1yZXXQrrUR0D6c3yGchdkBfowqbFlWsulYfKP/TJgS1jBMitaxXpDKdaCFYFci2UWBJgBQ4ZEqkW/x8OiPtXzFMml8YAUWwZ4zfdk5oWaniiNPhHOI47TugiX5eIf2Uma97rMKQ8uxgZ9VGatxIMQW3c6En/q0lBuD6+zkQEGO9fAO5AB7WASz+bbwtcwCzSZRgYgJy2CyZjJAx+9RPMB77975X80R1ZW2F3/Z96uTpzAsanWayb1FmKJgbu/vubgUcaSy0oSoDPf9MjbBLfkFNNxzXQxIgJOjY2DnCB+FFOAMergZjCA1qf265mFghnO1QKezBmsrz1AH7xdLKR9uJXkf9isLNGReo7RSrssnOyItIoIjKr24LhpqnImyRZn/WMgVVj3V4ZgeJ8qYV6ZttmBwN7Vjie29/vRDaGZCJB2ahb4suCkVyzVZsCK3TxLe6MuIQWkW+i7/RLrD8Gj+JcbOoptlUtEpDeGeBR2kFQpQlA5VTeM5EioPlRyb77I97G3ff6FDTG6gQ4efRPcUkPhm2jSA1zNo8WyJc+gCUQDYq5kDVFL6mv9AQWwmtgJvaTHWnRZy3MzJWdnCUBMWdkVdPdnt/tan9geoSoOY=----ATTACHMENT:----MzYwMDcyMzM3OTkwMDQ5NiA2NjE4MTc3MzU0Nzc0NTkwIDkyMjI0MTQxNDQ4NDU2ODg=