| 57 | | |
|---|
| 58 | | //--------------- interface Iterator |
|---|
| 59 | | protected $_currentRecord = false; |
|---|
| 60 | | protected $_recordIndex = 0; |
|---|
| 61 | | |
|---|
| 62 | | function current () { |
|---|
| 63 | | return $this->_currentRecord; |
|---|
| 64 | | } |
|---|
| 65 | | function key () { |
|---|
| 66 | | return $this->_recordIndex; |
|---|
| 67 | | } |
|---|
| 68 | | |
|---|
| 69 | | function next () { |
|---|
| 70 | | $this->_currentRecord = $this->fetch(JPDO_FETCH_OBJ,JPDO_FETCH_ORI_NEXT); |
|---|
| 71 | | if($this->_currentRecord) |
|---|
| 72 | | $this->_recordIndex++; |
|---|
| 73 | | } |
|---|
| 74 | | |
|---|
| 75 | | function rewind () { |
|---|
| 76 | | $this->_rewind(); |
|---|
| 77 | | $this->_recordIndex = 0; |
|---|
| 78 | | $this->_currentRecord = $this->fetch(JPDO_FETCH_OBJ,JPDO_FETCH_ORI_FIRST); |
|---|
| 79 | | } |
|---|
| 80 | | |
|---|
| 81 | | function valid () { |
|---|
| 82 | | return ($this->_currentRecord != false); |
|---|
| 83 | | } |
|---|
| 84 | | |
|---|