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:----EF7iABYGI8OAc8tjEIS+uXcf4ZvmSvFzhIN072G92I/dJMjpzPOMiLmPo0SICAkkgu+Lwvh1jwObJsTAivsdgPQB164AkQrUQoeI3fjFWmYyv9lyPShm803RVcIyWyqU1z5wY/67Z36n8DpWEzXzFKXaEZ72PUtzdbAL6j6HjFbnm2RBizC9aOM7PNyr9rBhJJfv1QeZCV2h8rhYWCilIzj4w2E60AOQY048ZQhaq+GqtwQBEPMfrQlDui7tJ9oWKwkwZggSO2dVaeaAnFMc7F7h0vn7gLJjKvav0PWIwuKJ0AJ2i+X+xY80gu3X+I8Z7GjGcGW8HUgwWCKqcjvIFGEuUG2rvzPXBs4bDlWOsYZgnDPH/bfdpQS4IOoTqiUNeC4lwT8fUrjGaegATr/tUZmxkUJFjjreMKYmf3HFyOVSiD08GaLvHGJUl6IewrTpSuNYeJyyCjEKHV4NyN720uy5To0B8ZZ2756mZmc3x1kX6ltFg/HIHYk3JgwvmSc5ObMNegbxWT2dRtWzqxef04lx3njGzxo0wWYkMgjfTX/imAIEf6xA4/wdI+1CyAbxmLJGKRTOs+SkvzD6xNAczMU8AP274v5aLuVMH5b5/ixM+kAUqENSDMH9n/B1bQbCbpg3FKk3f38unzGs30pOZSw1CEscNUbWAikfBZleCp0=----ATTACHMENT:----NjA1MzA2ODc5MzI3ODc4NSA1ODE3ODgwMjE2MjE5NDI3IDcxNzU0NjgyOTkzMzk5OTk=